Class: Karafka::Web::Ui::Controllers::ErrorsController
- Inherits:
-
BaseController
- Object
- BaseController
- Karafka::Web::Ui::Controllers::ErrorsController
- Defined in:
- lib/karafka/web/ui/controllers/errors_controller.rb
Overview
Errors displaying controller. It supports only scenarios with a single partition for errors. If you have high load of errors, consider going Pro
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#index ⇒ Object
Lists first page of the errors.
- #show(offset) ⇒ Object
Methods inherited from BaseController
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
#index ⇒ Object
Lists first page of the errors
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/karafka/web/ui/controllers/errors_controller.rb', line 11 def index @watermark_offsets = Models::WatermarkOffsets.find(errors_topic, 0) previous_offset, @error_messages, next_offset, = current_page_data paginate( previous_offset, @params.current_offset, next_offset, # If message is an array, it means it's a compacted dummy offset representation @error_messages.map { || .is_a?(Array) ? .last : .offset } ) render end |
#show(offset) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/karafka/web/ui/controllers/errors_controller.rb', line 27 def show(offset) @partition_id = 0 @offset = offset watermark_offsets = Models::WatermarkOffsets.find(errors_topic, @partition_id) @error_message = Models::Message.find( errors_topic, @partition_id, offset, watermark_offsets: watermark_offsets ) paginate(offset, watermark_offsets.low, watermark_offsets.high) render end |