From b2c19233bddbfaaa09bc5fd2f38f615bca04c402 Mon Sep 17 00:00:00 2001 From: Gaelen Hadlett Date: Wed, 4 Apr 2012 23:11:00 -0400 Subject: [PATCH] Fixed stat buckets that used sample rates. The stat was also sent, sometimes without data, based on incomplete sample rate logic. --- statsd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/statsd.py b/statsd.py index 1477388..aa8eb62 100644 --- a/statsd.py +++ b/statsd.py @@ -56,6 +56,8 @@ def _send(self, bucket, value, sample_rate=None): if sample_rate and sample_rate < 1.0 and sample_rate > 0: if random.random() <= sample_rate: value = value + b'|@' + str(sample_rate).encode('utf8') + else: + return stat = bucket + b':' + value if self._prefix: