Class: Karafka::Web::Pro::Ui::Controllers::Topics::OffsetsController
- Inherits:
-
BaseController
- Object
- Ui::Controllers::BaseController
- BaseController
- BaseController
- Karafka::Web::Pro::Ui::Controllers::Topics::OffsetsController
- Defined in:
- lib/karafka/web/pro/ui/controllers/topics/offsets_controller.rb
Overview
Controller responsible for viewing topics offsets details
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
-
#show(topic_name) ⇒ Object
Displays high and low offsets for given topic.
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
#show(topic_name) ⇒ Object
Displays high and low offsets for given topic
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/karafka/web/pro/ui/controllers/topics/offsets_controller.rb', line 24 def show(topic_name) @topic = Models::Topic.find(topic_name) @active_partitions, _materialized_page, @limited = Paginators::Partitions.call( @topic.partition_count, @params.current_page ) offsets = @active_partitions.map do |partition_id| part_offsets = Admin.read_watermark_offsets(topic_name, partition_id) { partition_id: partition_id, low: part_offsets.first, high: part_offsets.last, diff: part_offsets.last - part_offsets.first } end @offsets = refine(offsets) next_page = @active_partitions.last < @topic.partition_count - 1 paginate(@params.current_page, next_page) render end |