Class: Karafka::Web::Pro::Ui::Controllers::HealthController
- Inherits:
-
BaseController
- Object
- Ui::Controllers::BaseController
- BaseController
- Karafka::Web::Pro::Ui::Controllers::HealthController
- Defined in:
- lib/karafka/web/pro/ui/controllers/health_controller.rb
Overview
Health state controller
Constant Summary
Constants inherited from Ui::Controllers::BaseController
Ui::Controllers::BaseController::Models
Instance Attribute Summary
Attributes inherited from Ui::Controllers::BaseController
Instance Method Summary collapse
-
#changes ⇒ Object
Displays information related to time of changes of particular attributes.
-
#cluster_lags ⇒ Object
Displays lags for routing defined consumer groups taken from the cluster and not the metrics reported.
-
#lags ⇒ Object
Displays details about lags and their progression/statuses.
-
#offsets ⇒ Object
Displays details about offsets and their progression/statuses.
-
#overview ⇒ Object
Displays the current system state.
Methods inherited from Ui::Controllers::BaseController
Methods included from Ui::Controllers::Requests::Hookable
included, #run_after_hooks, #run_before_hooks
Constructor Details
This class inherits a constructor from Karafka::Web::Ui::Controllers::BaseController
Instance Method Details
#changes ⇒ Object
Displays information related to time of changes of particular attributes
79 80 81 82 83 84 |
# File 'lib/karafka/web/pro/ui/controllers/health_controller.rb', line 79 def changes # Same data as overview but presented differently overview render end |
#cluster_lags ⇒ Object
Displays lags for routing defined consumer groups taken from the cluster and not the metrics reported. This is useful when we don’t have any consumers running but still want to check lags because it shows what Kafka sees
60 61 62 63 64 65 66 67 68 |
# File 'lib/karafka/web/pro/ui/controllers/health_controller.rb', line 60 def cluster_lags @stats = Models::Health.cluster_lags_with_offsets @stats.each_value do |cg_details| cg_details.each_value { |topic_details| refine(topic_details) } end render end |
#lags ⇒ Object
Displays details about lags and their progression/statuses
50 51 52 53 54 55 |
# File 'lib/karafka/web/pro/ui/controllers/health_controller.rb', line 50 def lags # Same data as overview but presented differently overview render end |
#offsets ⇒ Object
Displays details about offsets and their progression/statuses
71 72 73 74 75 76 |
# File 'lib/karafka/web/pro/ui/controllers/health_controller.rb', line 71 def offsets # Same data as overview but presented differently overview render end |
#overview ⇒ Object
Displays the current system state
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/karafka/web/pro/ui/controllers/health_controller.rb', line 37 def overview current_state = Models::ConsumersState.current! @stats = Models::Health.current(current_state) # Refine only on a per topic basis not to resort higher levels @stats.each_value do |cg_details| cg_details.each_value { |topic_details| refine(topic_details) } end render end |