statsd: fixed timed logic
This commit is contained in:
parent
2672be414c
commit
2fb5b22ffd
1 changed files with 3 additions and 3 deletions
|
|
@ -44,9 +44,9 @@ class StatsClientBase(object):
|
|||
def pipeline(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
def timer(self, stat, rate=1, tags=None):
|
||||
def timer(self, stat, rate=1, tags=None, auto_send=True):
|
||||
"""
|
||||
statsd = StatsdClient()
|
||||
statsd = StatsdClient.statsd
|
||||
with statsd.timer('bucket_name', auto_send=True) as tmr:
|
||||
# This block will be timed.
|
||||
for i in xrange(0, 100000):
|
||||
|
|
@ -54,7 +54,7 @@ class StatsClientBase(object):
|
|||
# you can access time here...
|
||||
elapsed_ms = tmr.ms
|
||||
"""
|
||||
return Timer(self, stat, rate, tags)
|
||||
return Timer(self, stat, rate, tags, auto_send=auto_send)
|
||||
|
||||
def timing(self, stat, delta, rate=1, tags=None, use_decimals=True):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue