Skip to content

Commit

Permalink
Fix stat_suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Jan 28, 2014
1 parent a1e73f7 commit 1aa8f66
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sentry/tasks/base.py
Expand Up @@ -12,13 +12,12 @@


def instrumented_task(name, queue, stat_suffix=None, **kwargs):
statsd_key = 'jobs.duration.{name}'.format(name=name)
if stat_suffix:
statsd_key += '.{key}'.format(key=stat_suffix)

def wrapped(func):
@wraps(func)
def _wrapped(*args, **kwargs):
statsd_key = 'jobs.duration.{name}'.format(name=name)
if stat_suffix:
statsd_key += '.{key}'.format(key=stat_suffix(*args, **kwargs))
with statsd.timer(statsd_key):
result = func(*args, **kwargs)
return result
Expand Down

0 comments on commit 1aa8f66

Please sign in to comment.