prometheus

This commit is contained in:
wangchuxiao
2022-09-15 17:50:45 +08:00
parent 78ce5c3f69
commit 1cfa55817a
4 changed files with 31 additions and 0 deletions
+16
View File
@@ -64,3 +64,19 @@ func PromeAdd(counter prometheus.Counter, add int) {
}
}
}
func PromeGaugeInc(gauges prometheus.Gauge) {
if config.Config.Prometheus.Enable {
if gauges != nil {
gauges.Inc()
}
}
}
func PromeGaugeDec(gauges prometheus.Gauge) {
if config.Config.Prometheus.Enable {
if gauges != nil {
gauges.Dec()
}
}
}