Class: Karafka::Web::Ui::Controllers::Cluster
- Defined in:
- lib/karafka/web/ui/controllers/cluster.rb
Overview
Selects cluster info and topics basic info
Direct Known Subclasses
Instance Method Summary collapse
-
#brokers ⇒ Object
Lists available brokers in the cluster.
-
#topics ⇒ Object
List topics and partitions with details.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Karafka::Web::Ui::Controllers::Base
Instance Method Details
#brokers ⇒ Object
Lists available brokers in the cluster
21 22 23 24 25 |
# File 'lib/karafka/web/ui/controllers/cluster.rb', line 21 def brokers @brokers = refine(cluster_info.brokers) render end |
#topics ⇒ Object
List topics and partitions with details
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/karafka/web/ui/controllers/cluster.rb', line 28 def topics partitions_total = [] displayable_topics(cluster_info).each do |topic| topic[:partitions].each do |partition| partitions_total << partition.merge( topic: topic, # Will allow sorting by name topic_name: topic.fetch(:topic_name) ) end end @partitions, last_page = Ui::Lib::Paginations::Paginators::Arrays.call( refine(partitions_total), @params.current_page ) paginate(@params.current_page, !last_page) render end |