Skip to content

Commit

Permalink
added increment/decrement shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
wolph committed Jul 11, 2011
1 parent ebeaf21 commit 56d8907
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -6,7 +6,7 @@ def read(fname):

setup(
name = 'python-statsd',
version = '1.1',
version = '1.2',
author = 'Rick van Hattem',
author_email = 'Rick.van.Hattem@Fawo.nl',
description = '''statsd is a client for Etsy's node-js statsd server.
Expand Down
4 changes: 2 additions & 2 deletions statsd/__init__.py
@@ -1,7 +1,7 @@
from statsd.connection import Connection
from statsd.client import Client
from statsd.timer import Timer
from statsd.counter import Counter
from statsd.counter import Counter, increment, decrement

__all__ = ['Client', 'Connection', 'Timer', 'Counter']
__all__ = ['Client', 'Connection', 'Timer', 'Counter', 'increment', 'decrement']

6 changes: 6 additions & 0 deletions statsd/counter.py
Expand Up @@ -69,3 +69,9 @@ def __sub__(self, delta):
self.decrement(delta=delta)
return self

def increment(key):
counter = Counter(key).increment()

def decrement(key):
counter = Counter(key).decrement()

0 comments on commit 56d8907

Please sign in to comment.