Skip to content

Commit

Permalink
stats: add grafana stat key names for behavior stats (#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikreymer committed Aug 20, 2019
1 parent 24e0a3c commit b9d8fe7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions webrecorder/webrecorder/admincontroller.py
Expand Up @@ -119,6 +119,15 @@ def init_all_stats(self):
name = 'Sources ' + key[len(Stats.SOURCES_KEY.format('')):]
self.all_stats[name] = key

for key in self.redis.scan_iter(Stats.BEHAVIOR_KEY.format(stat='*', name='*')):
parts = key.split(':')
if len(parts) < 4:
continue
name = parts[3].replace('Behavior', '')
name = sub("([a-z])([A-Z])","\g<1>-\g<2>", name)
full_name = 'Behavior ' + parts[2] + ' ' + name
self.all_stats[full_name.title()] = key

for key in self.CUSTOM_STATS:
self.all_stats[key] = key

Expand Down

0 comments on commit b9d8fe7

Please sign in to comment.