prometheus for statistics

pull/351/head
skiffer-git 2 years ago
parent 375fc0c89e
commit 6a6009827c

@ -28,12 +28,17 @@ func PrometheusHandler() gin.HandlerFunc {
func PromeInc(counter prometheus.Counter) {
if config.Config.Prometheus.Enable {
counter.Inc()
if counter != nil {
counter.Inc()
}
}
}
func PromeAdd(counter prometheus.Counter, add int) {
if config.Config.Prometheus.Enable {
counter.Add(float64(add))
if counter != nil {
counter.Add(float64(add))
}
}
}

Loading…
Cancel
Save