Class: Karafka::Web::Ui::Controllers::ClusterController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/karafka/web/ui/controllers/cluster_controller.rb

Overview

Selects cluster info and topics basic info

Constant Summary

Constants inherited from BaseController

BaseController::Models

Instance Attribute Summary

Attributes inherited from BaseController

#params, #session

Instance Method Summary collapse

Methods inherited from BaseController

#cache, #initialize

Methods included from 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

#brokersObject

Lists available brokers in the cluster



24
25
26
27
28
# File 'lib/karafka/web/ui/controllers/cluster_controller.rb', line 24

def brokers
  @brokers = sort(Models::ClusterInfo.fetch.brokers)

  render
end

#replicationObject

List partitions replication details



31
32
33
34
35
36
37
38
39
40
# File 'lib/karafka/web/ui/controllers/cluster_controller.rb', line 31

def replication
  @partitions, last_page = Paginators::Arrays.call(
    sort(replication_partitions),
    @params.current_page
  )

  paginate(@params.current_page, !last_page)

  render
end