Class: Kirei::Metrics::StatsdBackend
- Extended by:
- T::Sig
- Defined in:
- lib/kirei/metrics/statsd_backend.rb
Instance Method Summary collapse
- #gauge(name, value, tags: {}) ⇒ Object
- #increment(name, value = 1, tags: {}) ⇒ Object
-
#initialize ⇒ StatsdBackend
constructor
A new instance of StatsdBackend.
- #measure(name, duration_ms, tags: {}) ⇒ Object
Constructor Details
#initialize ⇒ StatsdBackend
Returns a new instance of StatsdBackend.
10 11 12 13 14 15 |
# File 'lib/kirei/metrics/statsd_backend.rb', line 10 def initialize super return if defined?(::StatsD) raise "statsd-instrument is not loaded. Add `gem 'statsd-instrument'` to your Gemfile to use StatsdBackend." end |
Instance Method Details
#gauge(name, value, tags: {}) ⇒ Object
46 47 48 |
# File 'lib/kirei/metrics/statsd_backend.rb', line 46 def gauge(name, value, tags: {}) ::StatsD.gauge(name, value, tags: ) end |
#increment(name, value = 1, tags: {}) ⇒ Object
24 25 26 |
# File 'lib/kirei/metrics/statsd_backend.rb', line 24 def increment(name, value = 1, tags: {}) ::StatsD.increment(name, value, tags: ) end |
#measure(name, duration_ms, tags: {}) ⇒ Object
35 36 37 |
# File 'lib/kirei/metrics/statsd_backend.rb', line 35 def measure(name, duration_ms, tags: {}) ::StatsD.measure(name, duration_ms, tags: ) end |