Module: Sinatra::Helpers::Statsd

Defined in:
lib/sinatra-statsd-helper.rb

Constant Summary collapse

VERSION =
"0.2"

Instance Method Summary collapse

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_clientObject



10
11
12
# File 'lib/sinatra-statsd-helper.rb', line 10

def statsd_client
  request.env[::Statsd::Middleware::STATSD_DOT_CLIENT]
end

#statsd_host_clientObject



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_clientObject



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