Module: Karafka::Processing::InlineInsights::Consumer

Defined in:
lib/karafka/processing/inline_insights/consumer.rb

Overview

Module that adds extra methods to the consumer that allow us to fetch the insights

Instance Method Summary collapse

Instance Method Details

#insightsHash Also known as: statistics

Returns empty hash or hash with given partition insights if already present.

Returns:

  • (Hash)

    empty hash or hash with given partition insights if already present



14
15
16
# File 'lib/karafka/processing/inline_insights/consumer.rb', line 14

def insights
  Tracker.find(topic, partition)
end

#insights?Boolean Also known as: statistics?

Returns true if there are insights to work with, otherwise false.

Returns:

  • (Boolean)

    true if there are insights to work with, otherwise false



19
20
21
# File 'lib/karafka/processing/inline_insights/consumer.rb', line 19

def insights?
  Tracker.exists?(topic, partition)
end