Class: Metrics::Drivers::DogStatsd
- Defined in:
- lib/metrics/drivers/dog_statsd.rb
Instance Attribute Summary
Attributes inherited from Statsd
#client, #source_prefix, #template
Instance Method Summary collapse
Methods inherited from Statsd
Constructor Details
This class inherits a constructor from Metrics::Drivers::Statsd
Instance Method Details
#emit(instrumenter) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/metrics/drivers/dog_statsd.rb', line 4 def emit(instrumenter) name = name_for(instrumenter) value = instrumenter.value = (instrumenter.) case instrumenter.type when 'histogram' client.histogram(name, value, tags: ) when 'measure', 'sample' if instrumenter.units == 'ms' client.timing(name, value, tags: ) else client.gauge(name, value, tags: ) end when 'count' client.count(name, value, tags: ) else raise ArgumentError.new("unsupported instrumenter type for dogstatsd: '%s'" % instrumenter.type) end end |