Class: Deimos::Utils::LagReporter::ConsumerGroup
- Inherits:
-
Object
- Object
- Deimos::Utils::LagReporter::ConsumerGroup
- Defined in:
- lib/deimos/utils/lag_reporter.rb
Overview
Class that has a list of topics
Instance Attribute Summary collapse
Instance Method Summary collapse
- #assign_current_offset(topic, partition, offset) ⇒ void
-
#initialize(id) ⇒ ConsumerGroup
constructor
A new instance of ConsumerGroup.
- #report_lag(topic, partition) ⇒ void
Constructor Details
#initialize(id) ⇒ ConsumerGroup
Returns a new instance of ConsumerGroup.
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
#id ⇒ String
17 18 19 |
# File 'lib/deimos/utils/lag_reporter.rb', line 17 def id @id end |
#topics ⇒ Hash<String, Topic>
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.
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 |