Class: Honeybadger::Counter
Instance Attribute Summary
Attributes inherited from Metric
Instance Method Summary collapse
Methods inherited from Metric
#base_payload, #event_payloads, #initialize, #metric_type, metric_type, register, signature, #signature
Constructor Details
This class inherits a constructor from Honeybadger::Metric
Instance Method Details
#count(by = 1) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/honeybadger/counter.rb', line 5 def count(by=1) return unless by @samples += 1 @counter ||= 0 @counter = @counter + by end |
#payloads ⇒ Object
14 15 16 |
# File 'lib/honeybadger/counter.rb', line 14 def payloads [{ counter: @counter }] end |