Method: Datadog::Statsd#distribution_time
- Defined in:
- lib/datadog/statsd.rb
#distribution_time(stat, opts = EMPTY_OPTIONS) ⇒ Object
Reports execution time of the provided block as a distribution.
If the block fails, the stat is still reported, then the error is reraised
288 289 290 291 292 293 294 |
# File 'lib/datadog/statsd.rb', line 288 def distribution_time(stat, opts = EMPTY_OPTIONS) opts = { sample_rate: opts } if opts.is_a?(Numeric) start = now yield ensure distribution(stat, ((now - start) * 1000).round, opts) end |