public abstract static class KafkaMetrics.KafkaMetricsImpl extends java.lang.Object implements KafkaMetrics
Expected usage: A number of threads record metrics in an instance of this class with the
member methods. Afterwards, a single thread should call updateStreamingInsertsMetrics
which will export all counters metrics and RPC latency distribution metrics to the underlying
perWorkerMetrics
container. Afterwards, metrics should not be written/read from this
object.
KafkaMetrics.KafkaMetricsImpl, KafkaMetrics.NoOpKafkaMetrics
Constructor and Description |
---|
KafkaMetricsImpl() |
Modifier and Type | Method and Description |
---|---|
static KafkaMetrics.KafkaMetricsImpl |
create() |
void |
updateKafkaMetrics()
Export all metrics recorded in this instance to the underlying
perWorkerMetrics
containers. |
void |
updateSuccessfulRpcMetrics(java.lang.String topic,
java.time.Duration elapsedTime)
Record the rpc status and latency of a successful Kafka poll RPC call.
|
public static KafkaMetrics.KafkaMetricsImpl create()
public void updateSuccessfulRpcMetrics(java.lang.String topic, java.time.Duration elapsedTime)
updateSuccessfulRpcMetrics
in interface KafkaMetrics
public void updateKafkaMetrics()
perWorkerMetrics
containers. This function will only report metrics once per instance. Subsequent calls to
this function will no-op.updateKafkaMetrics
in interface KafkaMetrics