Module: Evil::Metrics::DSL::ClassMethods
- Defined in:
- lib/evil/metrics/dsl.rb
Instance Method Summary collapse
- #collect(&block) ⇒ Object
- #configure(&block) ⇒ Object
- #counter(*args, **kwargs) ⇒ Object
- #gauge(*args, **kwargs) ⇒ Object
- #group(group_name) ⇒ Object
- #histogram(*args, **kwargs) ⇒ Object
Instance Method Details
#collect(&block) ⇒ Object
21 22 23 |
# File 'lib/evil/metrics/dsl.rb', line 21 def collect(&block) ::Evil::Metrics.collectors.push(block) end |
#configure(&block) ⇒ Object
16 17 18 19 |
# File 'lib/evil/metrics/dsl.rb', line 16 def configure(&block) class_exec(&block) @group = nil end |
#counter(*args, **kwargs) ⇒ Object
29 30 31 |
# File 'lib/evil/metrics/dsl.rb', line 29 def counter(*args, **kwargs) register(Counter.new(*args, **kwargs, group: @group)) end |
#gauge(*args, **kwargs) ⇒ Object
33 34 35 |
# File 'lib/evil/metrics/dsl.rb', line 33 def gauge(*args, **kwargs) register(Gauge.new(*args, **kwargs, group: @group)) end |
#group(group_name) ⇒ Object
25 26 27 |
# File 'lib/evil/metrics/dsl.rb', line 25 def group(group_name) @group = group_name end |
#histogram(*args, **kwargs) ⇒ Object
37 38 39 |
# File 'lib/evil/metrics/dsl.rb', line 37 def histogram(*args, **kwargs) register(Histogram.new(*args, **kwargs, group: @group)) end |