Class: Karafka::Web::Processing::Consumers::Aggregators::State::Steps::IncrementCounters
- Inherits:
-
Base
- Object
- Base
- Karafka::Web::Processing::Consumers::Aggregators::State::Steps::IncrementCounters
- Defined in:
- lib/karafka/web/processing/consumers/aggregators/state/steps/increment_counters.rb
Overview
Increments the total counters based on the provided report.
Instance Method Summary collapse
-
#call ⇒ Object
Increments
context.state[:stats]totals fromcontext.report[:stats][:total].
Methods inherited from Base
Constructor Details
This class inherits a constructor from Karafka::Web::Processing::Consumers::Aggregators::State::Steps::Base
Instance Method Details
#call ⇒ Object
Increments context.state[:stats] totals from context.report[:stats][:total]
13 14 15 16 17 18 |
# File 'lib/karafka/web/processing/consumers/aggregators/state/steps/increment_counters.rb', line 13 def call context.report[:stats][:total].each do |key, value| context.state[:stats][key] ||= 0 context.state[:stats][key] += value end end |