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