General capabilities for xapps
- rmrendpoint helper structs
- rmr SendRetry to retry sending for given time (seconds).
Tries every 500ms until given timeout is reached or message was successfully sent
- few String() functions
Change-Id: I6bb163d85bb35a5375cd0b053d8968ebb0042bc3
Signed-off-by: Juha Hyttinen <juha.hyttinen@nokia.com>
diff --git a/pkg/xapp/metrics.go b/pkg/xapp/metrics.go
index aa4b0f7..c943db6 100644
--- a/pkg/xapp/metrics.go
+++ b/pkg/xapp/metrics.go
@@ -42,6 +42,18 @@
Gauges map[string]Gauge
}
+func (met *MetricGroupsCache) CInc(metric string) {
+ met.Counters[metric].Inc()
+}
+
+func (met *MetricGroupsCache) CAdd(metric string, val float64) {
+ met.Counters[metric].Add(val)
+}
+
+func (met *MetricGroupsCache) GSet(metric string, val float64) {
+ met.Gauges[metric].Set(val)
+}
+
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------