This commit is contained in:
wangchuxiao
2022-09-15 01:23:57 +08:00
8 changed files with 178 additions and 153 deletions
+7 -2
View File
@@ -51,12 +51,17 @@ func PromeTheusMiddleware(c *gin.Context) {
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))
}
}
}