From 7e5b62377fc500615408aa902b6bd99f72d59b55 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Wed, 14 Sep 2022 19:28:17 +0800 Subject: [PATCH] add --- pkg/common/prometheus/prometheus.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/common/prometheus/prometheus.go b/pkg/common/prometheus/prometheus.go index 12d5671bb..a6b65fee0 100644 --- a/pkg/common/prometheus/prometheus.go +++ b/pkg/common/prometheus/prometheus.go @@ -31,3 +31,9 @@ func PromeInc(counter prometheus.Counter) { counter.Inc() } } + +func PromeAdd(counter prometheus.Counter, add int) { + if config.Config.Prometheus.Enable { + counter.Add(float64(add)) + } +}