Class: Karafka::Web::Ui::Controllers::Errors

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/web/ui/controllers/errors.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

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Karafka::Web::Ui::Controllers::Base

Instance Method Details

#indexObject

Lists first page of the errors



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/karafka/web/ui/controllers/errors.rb', line 12

def index
  @watermark_offsets = Ui::Models::WatermarkOffsets.find(errors_topic, 0)
  previous_offset, @error_messages, next_offset, = current_page_data

  paginate(
    previous_offset,
    @params.current_offset,
    next_offset,
    @error_messages.map(&:offset)
  )

  render
end

#show(offset) ⇒ Object

Parameters:

  • offset (Integer)

    given error message offset



27
28
29
30
31
32
33
34
35
# File 'lib/karafka/web/ui/controllers/errors.rb', line 27

def show(offset)
  @error_message = Models::Message.find(
    errors_topic,
    0,
    offset
  )

  render
end