bellycard/napa — pull request #168 by danielmackey (2014-12-17 05:09:45+00:00)
Title: Add a sampling rate to StatsD timer

@bellycard/platform @bellycard/data

When measuring very fast jobs, the act of timing can have an impact on the method. This pull adds a sampling rate option of when to track.

```ruby
report_time('metric', sample_rate: 10) do
# your awesome code gets sampled every 10 milliseconds
end
```

If you don't pass in a `sample_rate`, if defaults to 1. A `sample_rate` of `x` means every `1:x` milliseconds will get logged.