Class: Evil::Metrics::Counter
- Defined in:
- lib/evil/metrics/counter.rb
Overview
Growing-only counter
Instance Attribute Summary
Attributes inherited from Metric
#comment, #group, #name, #per, #unit
Instance Method Summary collapse
Methods inherited from Metric
Constructor Details
This class inherits a constructor from Evil::Metrics::Metric
Instance Method Details
#increment(tags, by: 1) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/evil/metrics/counter.rb', line 7 def increment(, by: 1) values[] += by ::Evil::Metrics.adapters.each do |_, adapter| adapter.perform_counter_increment!(self, , by) end values[] end |
#values ⇒ Object
15 16 17 |
# File 'lib/evil/metrics/counter.rb', line 15 def values @values ||= Concurrent::Hash.new(0) end |