public class KafkaOffsetMetric<K,V> extends Object implements IMetric
This class is used compute the partition and topic level offset metrics.
Partition level metrics are: topicName/partition{number}/earliestTimeOffset //gives beginning offset of the partition topicName/partition{number}/latestTimeOffset //gives end offset of the partition topicName/partition{number}/latestEmittedOffset //gives latest emitted offset of the partition from the spout topicName/partition{number}/latestCompletedOffset //gives latest committed offset of the partition from the spout topicName/partition{number}/spoutLag // the delta between the latest Offset and latestCompletedOffset topicName/partition{number}/recordsInPartition // total number of records in the partition
Topic level metrics are: topicName/totalEarliestTimeOffset //gives the total beginning offset of all the associated partitions of this spout topicName/totalLatestTimeOffset //gives the total end offset of all the associated partitions of this spout topicName/totalLatestEmittedOffset //gives the total latest emitted offset of all the associated partitions of this spout topicName/totalLatestCompletedOffset //gives the total latest committed offset of all the associated partitions of this spout topicName/spoutLag // total spout lag of all the associated partitions of this spout topicName/totalRecordsInPartitions //total number of records in all the associated partitions of this spout
Constructor and Description |
---|
KafkaOffsetMetric(Supplier<Map<org.apache.kafka.common.TopicPartition,OffsetManager>> offsetManagerSupplier,
Supplier<org.apache.kafka.clients.consumer.Consumer<K,V>> consumerSupplier) |
public Object getValueAndReset()
IMetric
Get value and reset.
getValueAndReset
in interface IMetric
IMetricsConsumer#handleDataPoints(org.apache.storm.metric.api.IMetricsConsumer
.TaskInfo,
java.util.Collection)
. If null is returned nothing will be sent. If this value can be reset, like with a counter, a side effect of calling this should be that the value is reset.Copyright © 2022 The Apache Software Foundation. All rights reserved.