Skip to content

Commit

Permalink
Merge "Moving AlarmgenUpdate stats from per-key to per-table. Closes-…
Browse files Browse the repository at this point in the history
…Bug:1582569" into R3.0
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed May 19, 2016
2 parents 9b94545 + 4ce7fa1 commit d461a26
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/analytics/viz.sandesh
Expand Up @@ -1778,7 +1778,8 @@ const list<stat_table> _STAT_TABLES = [
'obj_table' : 'NONE',
'attributes': [
{ 'name' : 'partition', 'datatype' : 'int', 'index' : true },
{ 'name' : 'o.key', 'datatype' : 'string', 'index' : true },
{ 'name' : 'table', 'datatype' : 'string', 'index' : true },
{ 'name' : 'o.keys', 'datatype' : 'int', 'index' : false },
{ 'name' : 'o.count', 'datatype' : 'int', 'index' : false },
]
},
Expand Down
14 changes: 7 additions & 7 deletions src/opserver/alarmgen.py
Expand Up @@ -49,7 +49,7 @@
AlarmgenStatus, AlarmgenStats, AlarmgenPartitionTrace, \
AlarmgenPartition, AlarmgenPartionInfo, AlarmgenUpdate, \
UVETableInfoReq, UVETableInfoResp, UVEObjectInfo, UVEStructInfo, \
UVETablePerfReq, UVETablePerfResp, UVETableInfo, UVEKeyCount, \
UVETablePerfReq, UVETablePerfResp, UVETableInfo, UVETableCount, \
UVEAlarmStateMachineInfo, UVEAlarmState, UVEAlarmOperState,\
AlarmStateChangeTrace

Expand Down Expand Up @@ -1491,21 +1491,21 @@ def process_stats(self):
dout = copy.deepcopy(self._uvestats[pk])
self._uvestats[pk] = {}
for ktab,tab in dout.iteritems():
au_keys = []
utct = UVETableCount()
utct.keys = 0
utct.count = 0
for uk,uc in tab.iteritems():
s_keys.add(uk)
n_updates += uc
ukc = UVEKeyCount()
ukc.key = uk
ukc.count = uc
au_keys.append(ukc)
utct.keys += 1
utct.count += uc
au_obj = AlarmgenUpdate(name=self._sandesh._source + ':' + \
self._sandesh._node_type + ':' + \
self._sandesh._module + ':' + \
self._sandesh._instance_id,
partition = pk,
table = ktab,
o = au_keys,
o = utct,
i = None,
sandesh=self._sandesh)
self._logger.debug('send output stats: %s' % (au_obj.log()))
Expand Down
6 changes: 3 additions & 3 deletions src/opserver/alarmgen_ctrl.sandesh
Expand Up @@ -162,8 +162,8 @@ struct UVETypeInfo {
4: u32 count
}

struct UVEKeyCount {
1: string key
struct UVETableCount {
1: u32 keys
2: u32 count
}

Expand All @@ -175,7 +175,7 @@ objectlog sandesh AlarmgenUpdate {
1: string name (key="ObjectGeneratorInfo")
3: u32 partition
4: string table
5: list<UVEKeyCount> o (tags="partition,.key")
5: UVETableCount o (tags="partition,table")
6: list<UVETypeInfo> i (tags="partition,table,.collector,.generator,.type")
}

Expand Down

0 comments on commit d461a26

Please sign in to comment.