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