diff --git a/pystatsd/statsd.py b/pystatsd/statsd.py index 29b14d1..8c61eb0 100644 --- a/pystatsd/statsd.py +++ b/pystatsd/statsd.py @@ -61,6 +61,9 @@ def increment(self, stats, sample_rate=1): """ self.update_stats(stats, 1, sample_rate=sample_rate) + # alias + incr = increment + def decrement(self, stats, sample_rate=1): """ Decrements one or more stats counters @@ -68,6 +71,9 @@ def decrement(self, stats, sample_rate=1): """ self.update_stats(stats, -1, sample_rate=sample_rate) + # alias + decr = decrement + def update_stats(self, stats, delta, sample_rate=1): """ Updates one or more stats counters by arbitrary amounts @@ -98,3 +104,6 @@ def send(self, data, sample_rate=1): [self.udp_sock.sendto("%s:%s" % (stat, value), self.addr) for stat, value in sampled_data.iteritems()] except: self.log.exception("unexpected error") + + def __repr__(self): + return "" % (self.addr, self.prefix)