Skip to content

Commit

Permalink
Fix sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
tobi committed Sep 4, 2012
1 parent d6cdcfc commit d0a6b62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/statsd/instrument.rb
Expand Up @@ -129,7 +129,7 @@ def self.socket


def self.write(k,v,op, sample_rate = default_sample_rate) def self.write(k,v,op, sample_rate = default_sample_rate)
return unless enabled return unless enabled
return if sample_rate < 1 && rand > sample_rate return if sample_rate < 1 && rand < sample_rate


command = "#{self.prefix + '.' if self.prefix}#{k}:#{v}" command = "#{self.prefix + '.' if self.prefix}#{k}:#{v}"
case op case op
Expand Down

0 comments on commit d0a6b62

Please sign in to comment.