public class KafkaOffsetMetric<K,V> extends Object implements IMetric
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
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 © 2023 The Apache Software Foundation. All rights reserved.