=========
Added support for name prefix when creating group from vector

Example:
vect:=RegisterCounterVecGroup(
	[]CounterOpts{{Name: "counter", Help: "counter"},},
	[]string{"name", "event"},
	"SUBSSYSTEM")

grp1:=GetCounterGroupFromVectsWithPrefix("event1_", []string{"name1", "event1"}, vect)
grp2:=GetCounterGroupFromVectsWithPrefix("event2_", []string{"name1", "event2"}, vect)
grp:=CombineCounterGroups(grp1,grp2)

grp["event1_counter"].Inc() -> increments "counter" (NAMESPACE_SUBSYSTEM_counter) with labels: "name=name1", "event=event1"
grp["event2_counter"].Inc() -> increments "counter" (NAMESPACE_SUBSYSTEM_counter) with labels: "name=name1", "event=event2"

=========
Added cache support for created metric groups

Example (uses prev example groups):

cacheid := "CACHEID"
entry := xapp.Metric.GroupCacheGet(cacheid)
if entry == nil {
	xapp.Metric.GroupCacheAddCounters(cacheid, grp1)
	xapp.Metric.GroupCacheAddCounters(cacheid, grp2)
	entry = xapp.Metric.GroupCacheGet(cacheid)
}
entry.Counters["event1_counter"].Inc() -> increments "counter" (NAMESPACE_SUBSYSTEM_counter) with labels: "name=name1", "event=event1"
entry.Counters["event2_counter"].Inc() -> increments "counter" (NAMESPACE_SUBSYSTEM_counter) with labels: "name=name1", "event=event2"

Change-Id: Ic9b827d1dbf32a344302d7974457edf9411d2b78
Signed-off-by: Juha Hyttinen <juha.hyttinen@nokia.com>
2 files changed