Skip to content

Commit

Permalink
Fixed stat buckets that used sample rates.
Browse files Browse the repository at this point in the history
The stat was also sent, sometimes without data, based
on incomplete sample rate logic.
  • Loading branch information
gaelen committed Apr 5, 2012
1 parent e49ce52 commit b2c1923
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions statsd.py
Expand Up @@ -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:
Expand Down

0 comments on commit b2c1923

Please sign in to comment.