Class: Karafka::Web::Ui::Models::Status::Checks::Topics

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/web/ui/models/status/checks/topics.rb

Overview

Checks if all required Web UI topics exist in the Kafka cluster.

The Web UI requires several topics to function:

  • consumers states topic

  • consumers reports topic

  • consumers metrics topic

  • errors topic

Class Method Summary collapse

Instance Method Summary collapse

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_detailsHash

Returns empty hash for halted state.

Returns:

  • (Hash)

    empty hash for halted state



21
22
23
# File 'lib/karafka/web/ui/models/status/checks/topics.rb', line 21

def halted_details
  {}
end

Instance Method Details

#callStatus::Step

Executes the topics check.

Verifies that all required topics exist by checking the cluster info cached in the context.

Returns:



32
33
34
35
36
37
# File 'lib/karafka/web/ui/models/status/checks/topics.rb', line 32

def call
  details = context.topics_details
  status = (details.all? { |_, detail| detail[:present] }) ? :success : :failure

  step(status, details)
end