Class: Karafka::Web::Ui::Models::Status::Checks::Partitions
- Defined in:
- lib/karafka/web/ui/models/status/checks/partitions.rb
Overview
Checks if required Web UI topics have the correct number of partitions.
The consumers states, reports, and metrics topics must have exactly 1 partition each for the Web UI to function correctly. The errors topic can have any number of partitions.
Class Method Summary collapse
-
.halted_details ⇒ Hash
Empty hash for halted state.
Instance Method Summary collapse
-
#call ⇒ Status::Step
Executes the partitions check.
Methods inherited from Base
depends_on, independent!, independent?, #initialize
Constructor Details
This class inherits a constructor from Karafka::Web::Ui::Models::Status::Checks::Base
Class Method Details
.halted_details ⇒ Hash
Returns empty hash for halted state.
19 20 21 |
# File 'lib/karafka/web/ui/models/status/checks/partitions.rb', line 19 def halted_details {} end |
Instance Method Details
#call ⇒ Status::Step
Executes the partitions check.
Verifies that state, reports, and metrics topics have exactly 1 partition.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/karafka/web/ui/models/status/checks/partitions.rb', line 29 def call details = context.topics_details status = :success status = :failure if details[context.topics_consumers_states][:partitions] != 1 status = :failure if details[context.topics_consumers_reports][:partitions] != 1 status = :failure if details[context.topics_consumers_metrics][:partitions] != 1 step(status, details) end |