Class 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 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.

    • Constructor Detail

      • KafkaMetricsImpl

        public KafkaMetricsImpl()
    • Method Detail

      • 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:
        updateSuccessfulRpcMetrics in interface KafkaMetrics
      • updateKafkaMetrics

        public void updateKafkaMetrics()
        Export all metrics recorded in this instance to the underlying perWorkerMetrics containers. This function will only report metrics once per instance. Subsequent calls to this function will no-op.
        Specified by:
        updateKafkaMetrics in interface KafkaMetrics