Gauge add 92/6392/1 v0.8.4
authorJuha Hyttinen <juha.hyttinen@nokia.com>
Wed, 23 Jun 2021 07:54:57 +0000 (10:54 +0300)
committerJuha Hyttinen <juha.hyttinen@nokia.com>
Wed, 23 Jun 2021 07:55:04 +0000 (10:55 +0300)
Change-Id: I6e1fdec0741f9e0bbbf5c330a8d146095afc6a44
Signed-off-by: Juha Hyttinen <juha.hyttinen@nokia.com>
pkg/xapp/metrics.go

index f85c488..40adbcd 100644 (file)
@@ -89,6 +89,12 @@ func (met *MetricGroupsCache) GSet(metric string, val float64) {
        met.gauges[metric].Set(val)
 }
 
+func (met *MetricGroupsCache) GAdd(metric string, val float64) {
+       met.RLock()
+       defer met.RUnlock()
+       met.gauges[metric].Add(val)
+}
+
 func (met *MetricGroupsCache) GInc(metric string) {
        met.RLock()
        defer met.RUnlock()