Module: Octo::Stats
- Included in:
- Helpers::ApiHelper
- Defined in:
- lib/octocore-cassandra/stats.rb
Overview
Instrumentation and Statistical module
Instance Method Summary collapse
-
#instrument(name) ⇒ Object
Instrument a block identified by its name.
-
#stats ⇒ Object
Get stats instance.
Instance Method Details
#instrument(name) ⇒ Object
Instrument a block identified by its name
10 11 12 13 14 15 16 |
# File 'lib/octocore-cassandra/stats.rb', line 10 def instrument(name) if stats stats.time(name.to_s, &Proc.new) else yield end end |
#stats ⇒ Object
Get stats instance
19 20 21 22 23 24 |
# File 'lib/octocore-cassandra/stats.rb', line 19 def stats if statd_config @statsd = Statsd.new(*statd_config.values) unless @statsd @statsd end end |