Skip to content

Commit

Permalink
Add additional tag support to CounterWrapper
Browse files Browse the repository at this point in the history
Signed-off-by: James Mitchell <[email protected]>
  • Loading branch information
jsmitchell committed Sep 30, 2017
1 parent 0e17c9b commit 6259ec8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions validator/sawtooth_validator/metrics/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ def gauge(self, name, default=0):
''.join([name, ',host=', platform.node()]),
default=default)

def counter(self, name):
def counter(self, name, tags=None):
if not tags:
tags = []
return self._registry.counter(
''.join([name, ',host=', platform.node()]))
','.join([name, 'host={}'.format(platform.node())] + tags))

def timer(self, name, tags=None):
if not tags:
Expand Down

0 comments on commit 6259ec8

Please sign in to comment.