Class: Deimos::Utils::LagReporter::ConsumerGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/deimos/utils/lag_reporter.rb

Overview

Class that has a list of topics

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ ConsumerGroup

Returns a new instance of ConsumerGroup.

Parameters:

  • id (String)


20
21
22
23
# File 'lib/deimos/utils/lag_reporter.rb', line 20

def initialize(id)
  self.id = id
  self.topics = {}
end

Instance Attribute Details

#idString

Returns:

  • (String)


17
18
19
# File 'lib/deimos/utils/lag_reporter.rb', line 17

def id
  @id
end

#topicsHash<String, Topic>

Returns:



15
16
17
# File 'lib/deimos/utils/lag_reporter.rb', line 15

def topics
  @topics
end

Instance Method Details

#assign_current_offset(topic, partition, offset) ⇒ void

This method returns an undefined value.

Parameters:

  • topic (String)
  • partition (Integer)
  • offset (Integer)


37
38
39
40
# File 'lib/deimos/utils/lag_reporter.rb', line 37

def assign_current_offset(topic, partition, offset)
  self.topics[topic.to_s] ||= Topic.new(topic, self)
  self.topics[topic.to_s].assign_current_offset(partition, offset)
end

#report_lag(topic, partition) ⇒ void

This method returns an undefined value.

Parameters:

  • topic (String)
  • partition (Integer)


28
29
30
31
# File 'lib/deimos/utils/lag_reporter.rb', line 28

def report_lag(topic, partition)
  self.topics[topic.to_s] ||= Topic.new(topic, self)
  self.topics[topic.to_s].report_lag(partition)
end