Class: KafkaCommand::ConsumerGroupPartition

Inherits:
Object
  • Object
show all
Defined in:
app/models/kafka_command/consumer_group_partition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lag:, topic_name:, offset:, group_id:, partition_id:) ⇒ ConsumerGroupPartition

Returns a new instance of ConsumerGroupPartition.



7
8
9
10
11
12
13
# File 'app/models/kafka_command/consumer_group_partition.rb', line 7

def initialize(lag:, topic_name:, offset:, group_id:, partition_id:)
  @group_id     = group_id
  @lag          = lag
  @topic_name   = topic_name
  @offset       = offset
  @partition_id = partition_id
end

Instance Attribute Details

#group_idObject (readonly)

Returns the value of attribute group_id.



5
6
7
# File 'app/models/kafka_command/consumer_group_partition.rb', line 5

def group_id
  @group_id
end

#lagObject (readonly)

Returns the value of attribute lag.



5
6
7
# File 'app/models/kafka_command/consumer_group_partition.rb', line 5

def lag
  @lag
end

#offsetObject (readonly)

Returns the value of attribute offset.



5
6
7
# File 'app/models/kafka_command/consumer_group_partition.rb', line 5

def offset
  @offset
end

#partition_idObject (readonly)

Returns the value of attribute partition_id.



5
6
7
# File 'app/models/kafka_command/consumer_group_partition.rb', line 5

def partition_id
  @partition_id
end

#topic_nameObject (readonly)

Returns the value of attribute topic_name.



5
6
7
# File 'app/models/kafka_command/consumer_group_partition.rb', line 5

def topic_name
  @topic_name
end

Instance Method Details

#as_jsonObject



15
16
17
18
19
20
21
# File 'app/models/kafka_command/consumer_group_partition.rb', line 15

def as_json(*)
  {
    lag: @lag,
    offset: @offset,
    partition_id: @partition_id
  }
end