Class: Karafka::Web::Pro::Ui::Controllers::Consumers::ConsumersController
- Inherits:
-
BaseController
- Object
- Ui::Controllers::BaseController
- BaseController
- BaseController
- Karafka::Web::Pro::Ui::Controllers::Consumers::ConsumersController
- Includes:
- Ui::Lib::Paginations
- Defined in:
- lib/karafka/web/pro/ui/controllers/consumers/consumers_controller.rb
Overview
Controller for displaying consumers states and details about them
Direct Known Subclasses
ControlsController, JobsController, Partitions::BaseController
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
- #details(process_id) ⇒ Object
-
#index ⇒ Object
Consumers list.
-
#performance ⇒ Object
Displays per-process performance details.
- #subscriptions(process_id) ⇒ Object
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
#details(process_id) ⇒ Object
95 96 97 98 99 100 |
# File 'lib/karafka/web/pro/ui/controllers/consumers/consumers_controller.rb', line 95 def details(process_id) current_state = Models::ConsumersState.current! @process = Models::Process.find(current_state, process_id) render end |
#index ⇒ Object
Consumers list
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/karafka/web/pro/ui/controllers/consumers/consumers_controller.rb', line 73 def index @current_state = Models::ConsumersState.current! @counters = Models::Counters.new(@current_state) @processes, last_page = Paginators::Arrays.call( refine(Models::Processes.active(@current_state)), @params.current_page ) paginate(@params.current_page, !last_page) render end |
#performance ⇒ Object
Displays per-process performance details
88 89 90 91 92 |
# File 'lib/karafka/web/pro/ui/controllers/consumers/consumers_controller.rb', line 88 def performance index render end |
#subscriptions(process_id) ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/karafka/web/pro/ui/controllers/consumers/consumers_controller.rb', line 103 def subscriptions(process_id) details(process_id) # We want to have sorting but on a per subscription group basis and not to sort # everything @process.consumer_groups.each do |consumer_group| # We need to initialize the whole structure so dynamic fields are also built into # the underlying hashes for sorting consumer_group.subscription_groups.flat_map(&:topics).flat_map(&:partitions) refine(consumer_group) end render end |