Package org.apache.beam.sdk.io.kafka
Class KafkaMetrics.KafkaMetricsImpl
- java.lang.Object
-
- org.apache.beam.sdk.io.kafka.KafkaMetrics.KafkaMetricsImpl
-
- All Implemented Interfaces:
KafkaMetrics
- Enclosing interface:
- KafkaMetrics
public abstract static class KafkaMetrics.KafkaMetricsImpl extends java.lang.Object implements KafkaMetrics
Metrics of a batch of RPCs. Member variables are thread safe; however, this class does not have atomicity across member variables.Expected usage: A number of threads record metrics in an instance of this class with the member methods. Afterwards, a single thread should call
updateStreamingInsertsMetricswhich will export all counters metrics and RPC latency distribution metrics to the underlyingperWorkerMetricscontainer. Afterwards, metrics should not be written/read from this object.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.beam.sdk.io.kafka.KafkaMetrics
KafkaMetrics.KafkaMetricsImpl, KafkaMetrics.NoOpKafkaMetrics
-
-
Constructor Summary
Constructors Constructor Description KafkaMetricsImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KafkaMetrics.KafkaMetricsImplcreate()voidupdateKafkaMetrics()Export all metrics recorded in this instance to the underlyingperWorkerMetricscontainers.voidupdateSuccessfulRpcMetrics(java.lang.String topic, java.time.Duration elapsedTime)Record the rpc status and latency of a successful Kafka poll RPC call.
-
-
-
Method Detail
-
create
public static KafkaMetrics.KafkaMetricsImpl create()
-
updateSuccessfulRpcMetrics
public void updateSuccessfulRpcMetrics(java.lang.String topic, java.time.Duration elapsedTime)Record the rpc status and latency of a successful Kafka poll RPC call.- Specified by:
updateSuccessfulRpcMetricsin interfaceKafkaMetrics
-
updateKafkaMetrics
public void updateKafkaMetrics()
Export all metrics recorded in this instance to the underlyingperWorkerMetricscontainers. This function will only report metrics once per instance. Subsequent calls to this function will no-op.- Specified by:
updateKafkaMetricsin interfaceKafkaMetrics
-
-