Class: Karafka::Web::Ui::Models::Counters
- Inherits:
-
Lib::HashProxy
- Object
- Lib::HashProxy
- Karafka::Web::Ui::Models::Counters
- Defined in:
- lib/karafka/web/ui/models/counters.rb
Overview
Represents the top counters bar values on the consumers view
Instance Method Summary collapse
-
#initialize(state) ⇒ Counters
constructor
A new instance of Counters.
-
#pending ⇒ Integer
Number of jobs that are not yet running.
Methods inherited from Lib::HashProxy
#method_missing, #respond_to_missing?, #to_h
Constructor Details
#initialize(state) ⇒ Counters
Returns a new instance of Counters.
15 16 17 18 |
# File 'lib/karafka/web/ui/models/counters.rb', line 15 def initialize(state) super(state[:stats]) @hash[:errors] = estimate_errors_count end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Karafka::Web::Ui::Lib::HashProxy
Instance Method Details
#pending ⇒ Integer
Returns number of jobs that are not yet running. This includes jobs on the workers queue as well as jobs in the scheduling.
22 23 24 |
# File 'lib/karafka/web/ui/models/counters.rb', line 22 def pending enqueued + waiting end |