Code Review
/
ric-plt
/
xapp-frame.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Newer go version 1.13 and above support
[ric-plt/xapp-frame.git]
/
pkg
/
xapp
/
metrics.go
diff --git
a/pkg/xapp/metrics.go
b/pkg/xapp/metrics.go
index
96f407c
..
40adbcd
100644
(file)
--- a/
pkg/xapp/metrics.go
+++ b/
pkg/xapp/metrics.go
@@
-52,6
+52,12
@@
func (met *MetricGroupsCache) CIs(metric string) bool {
return ok
}
return ok
}
+func (met *MetricGroupsCache) CGet(metric string) Counter {
+ met.RLock()
+ defer met.RUnlock()
+ return met.counters[metric]
+}
+
func (met *MetricGroupsCache) CInc(metric string) {
met.RLock()
defer met.RUnlock()
func (met *MetricGroupsCache) CInc(metric string) {
met.RLock()
defer met.RUnlock()
@@
-71,12
+77,24
@@
func (met *MetricGroupsCache) GIs(metric string) bool {
return ok
}
return ok
}
+func (met *MetricGroupsCache) GGet(metric string) Gauge {
+ met.RLock()
+ defer met.RUnlock()
+ return met.gauges[metric]
+}
+
func (met *MetricGroupsCache) GSet(metric string, val float64) {
met.RLock()
defer met.RUnlock()
met.gauges[metric].Set(val)
}
func (met *MetricGroupsCache) GSet(metric string, val float64) {
met.RLock()
defer met.RUnlock()
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()
func (met *MetricGroupsCache) GInc(metric string) {
met.RLock()
defer met.RUnlock()