public static final class KafkaMetricsCollector.StateLedger extends Object implements org.apache.kafka.common.metrics.MetricsReporter
Note that this class doesn't have a context object, so it can't use the real MetricKey (with contex.labels()). The StateLedger is created earlier in the process so that it can handle the MetricsReporter methods (init/metricChange,metricRemoval).
Constructor and Description |
---|
StateLedger() |
StateLedger(LastValueTracker<Double> doubleDeltas,
Clock clock) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
configure(Map<String,?> configs) |
LastValueTracker.InstantAndValue<Double> |
delta(org.apache.kafka.common.MetricName metricName,
Instant now,
Double value) |
Iterable<? extends Map.Entry<org.apache.kafka.common.MetricName,org.apache.kafka.common.metrics.KafkaMetric>> |
getMetrics() |
void |
init(List<org.apache.kafka.common.metrics.KafkaMetric> metrics) |
void |
metricChange(org.apache.kafka.common.metrics.KafkaMetric metric) |
void |
metricRemoval(org.apache.kafka.common.metrics.KafkaMetric metric) |
public StateLedger()
public StateLedger(LastValueTracker<Double> doubleDeltas, Clock clock)
public void init(List<org.apache.kafka.common.metrics.KafkaMetric> metrics)
init
in interface org.apache.kafka.common.metrics.MetricsReporter
public void metricChange(org.apache.kafka.common.metrics.KafkaMetric metric)
metricChange
in interface org.apache.kafka.common.metrics.MetricsReporter
public void metricRemoval(org.apache.kafka.common.metrics.KafkaMetric metric)
metricRemoval
in interface org.apache.kafka.common.metrics.MetricsReporter
public Iterable<? extends Map.Entry<org.apache.kafka.common.MetricName,org.apache.kafka.common.metrics.KafkaMetric>> getMetrics()
public LastValueTracker.InstantAndValue<Double> delta(org.apache.kafka.common.MetricName metricName, Instant now, Double value)
public void close()
close
in interface AutoCloseable
close
in interface org.apache.kafka.common.metrics.MetricsReporter