Module: Sinatra::Helpers::Statsd
- Defined in:
- lib/sinatra-statsd-helper.rb
Constant Summary collapse
- VERSION =
"0.2"
Instance Method Summary collapse
- #increment_all(key) ⇒ Object
- #increment_host(key) ⇒ Object
- #increment_service(key) ⇒ Object
- #statsd_client ⇒ Object
- #statsd_host_client ⇒ Object
- #statsd_service_client ⇒ Object
- #timer_all(key) ⇒ Object
- #timer_host(key) ⇒ Object
- #timer_service(key) ⇒ Object
Instance Method Details
#increment_all(key) ⇒ Object
30 31 32 33 |
# File 'lib/sinatra-statsd-helper.rb', line 30 def increment_all(key) increment_host(key) increment_service(key) end |
#increment_host(key) ⇒ Object
22 23 24 |
# File 'lib/sinatra-statsd-helper.rb', line 22 def increment_host(key) request.env[::Statsd::Middleware::STATSD_DOT_HOST_DOT_INCREMENTS] << key end |
#increment_service(key) ⇒ Object
26 27 28 |
# File 'lib/sinatra-statsd-helper.rb', line 26 def increment_service(key) request.env[::Statsd::Middleware::STATSD_DOT_SERVICE_DOT_INCREMENTS] << key end |
#statsd_client ⇒ Object
10 11 12 |
# File 'lib/sinatra-statsd-helper.rb', line 10 def statsd_client request.env[::Statsd::Middleware::STATSD_DOT_CLIENT] end |
#statsd_host_client ⇒ Object
14 15 16 |
# File 'lib/sinatra-statsd-helper.rb', line 14 def statsd_host_client request.env[::Statsd::Middleware::STATSD_DOT_HOST_DOT_CLIENT] end |
#statsd_service_client ⇒ Object
18 19 20 |
# File 'lib/sinatra-statsd-helper.rb', line 18 def statsd_service_client request.env[::Statsd::Middleware::STATSD_DOT_SERVICE_DOT_CLIENT] end |
#timer_all(key) ⇒ Object
43 44 45 46 |
# File 'lib/sinatra-statsd-helper.rb', line 43 def timer_all(key) timer_host(key) timer_service(key) end |
#timer_host(key) ⇒ Object
35 36 37 |
# File 'lib/sinatra-statsd-helper.rb', line 35 def timer_host(key) request.env[::Statsd::Middleware::STATSD_DOT_HOST_DOT_TIMERS] << key end |
#timer_service(key) ⇒ Object
39 40 41 |
# File 'lib/sinatra-statsd-helper.rb', line 39 def timer_service(key) request.env[::Statsd::Middleware::STATSD_DOT_SERVICE_DOT_TIMERS] << key end |