Skip to content

Commit

Permalink
Adds use_ms property, bumps version
Browse files Browse the repository at this point in the history
  • Loading branch information
volker48 committed Jan 27, 2016
1 parent 0cd074e commit 170d31f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion flask_datadog.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def stop(self):

class StatsD(object):
def __init__(self, app=None, config=None):
self.config = None
self.config = config
self.statsd = None
if app is not None:
self.init_app(app)
Expand All @@ -30,12 +30,17 @@ def init_app(self, app, config=None):
self.config.setdefault('STATSD_HOST', 'localhost')
self.config.setdefault('STATSD_PORT', 8125)
self.config.setdefault('STATSD_TAGS', None)
self.config.setdefault('STATSD_USEMS', False)

self.app = app

self.statsd = DogStatsd(self.config['STATSD_HOST'],
self.config['STATSD_PORT'], self.config['STATSD_TAGS'])

@property
def use_ms(self):
return self.config.get('use_ms', False)

def timer(self, *args, **kwargs):
return TimerWrapper(self.statsd, *args, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='Flask-Datadog',
version='0.1.1',
version='0.1.2',
url='https://github.com/50onRed/flask-datadog.git',
license='BSD',
author='50onRed',
Expand Down

0 comments on commit 170d31f

Please sign in to comment.