public AsyncConsumerMetrics()

in clients/src/main/java/org/apache/kafka/clients/consumer/internals/metrics/AsyncConsumerMetrics.java [54:204]


    public AsyncConsumerMetrics(Metrics metrics) {
        super(metrics, CONSUMER_METRIC_GROUP_PREFIX);

        this.metrics = metrics;
        this.timeBetweenNetworkThreadPollSensor = metrics.sensor(TIME_BETWEEN_NETWORK_THREAD_POLL_SENSOR_NAME);
        this.timeBetweenNetworkThreadPollSensor.add(
            metrics.metricName(
                "time-between-network-thread-poll-avg",
                CONSUMER_METRIC_GROUP,
                "The average time taken, in milliseconds, between each poll in the network thread."
            ),
            new Avg()
        );
        this.timeBetweenNetworkThreadPollSensor.add(
            metrics.metricName(
                "time-between-network-thread-poll-max",
                CONSUMER_METRIC_GROUP,
                "The maximum time taken, in milliseconds, between each poll in the network thread."
            ),
            new Max()
        );

        this.applicationEventQueueSizeSensor = metrics.sensor(APPLICATION_EVENT_QUEUE_SIZE_SENSOR_NAME);
        this.applicationEventQueueSizeSensor.add(
            metrics.metricName(
                APPLICATION_EVENT_QUEUE_SIZE_SENSOR_NAME,
                CONSUMER_METRIC_GROUP,
                "The current number of events in the queue to send from the application thread to the background thread."
            ),
            new Value()
        );

        this.applicationEventQueueTimeSensor = metrics.sensor(APPLICATION_EVENT_QUEUE_TIME_SENSOR_NAME);
        this.applicationEventQueueTimeSensor.add(
            metrics.metricName(
                "application-event-queue-time-avg",
                CONSUMER_METRIC_GROUP,
                "The average time, in milliseconds, that application events are taking to be dequeued."
            ),
            new Avg()
        );
        this.applicationEventQueueTimeSensor.add(
            metrics.metricName(
                "application-event-queue-time-max",
                CONSUMER_METRIC_GROUP,
                "The maximum time, in milliseconds, that an application event took to be dequeued."
            ),
            new Max()
        );

        this.applicationEventQueueProcessingTimeSensor = metrics.sensor(APPLICATION_EVENT_QUEUE_PROCESSING_TIME_SENSOR_NAME);
        this.applicationEventQueueProcessingTimeSensor.add(
            metrics.metricName(
                "application-event-queue-processing-time-avg",
                CONSUMER_METRIC_GROUP,
                "The average time, in milliseconds, that the background thread takes to process all available application events."
            ),
            new Avg()
        );
        this.applicationEventQueueProcessingTimeSensor.add(
            metrics.metricName("application-event-queue-processing-time-max",
                CONSUMER_METRIC_GROUP,
                "The maximum time, in milliseconds, that the background thread took to process all available application events."
            ),
            new Max()
        );

        this.applicationEventExpiredSizeSensor = metrics.sensor(APPLICATION_EVENT_EXPIRED_SIZE_SENSOR_NAME);
        this.applicationEventExpiredSizeSensor.add(
            metrics.metricName(
                APPLICATION_EVENT_EXPIRED_SIZE_SENSOR_NAME,
                CONSUMER_METRIC_GROUP,
                "The current number of expired application events."
            ),
            new Value()
        );

        this.unsentRequestsQueueSizeSensor = metrics.sensor(UNSENT_REQUESTS_QUEUE_SIZE_SENSOR_NAME);
        this.unsentRequestsQueueSizeSensor.add(
            metrics.metricName(
                UNSENT_REQUESTS_QUEUE_SIZE_SENSOR_NAME,
                CONSUMER_METRIC_GROUP,
                "The current number of unsent requests in the background thread."
            ),
            new Value()
        );

        this.unsentRequestsQueueTimeSensor = metrics.sensor(UNSENT_REQUESTS_QUEUE_TIME_SENSOR_NAME);
        this.unsentRequestsQueueTimeSensor.add(
            metrics.metricName(
                "unsent-requests-queue-time-avg",
                CONSUMER_METRIC_GROUP,
                "The average time, in milliseconds, that requests are taking to be sent in the background thread."
            ),
            new Avg()
        );
        this.unsentRequestsQueueTimeSensor.add(
            metrics.metricName(
                "unsent-requests-queue-time-max",
                CONSUMER_METRIC_GROUP,
                "The maximum time, in milliseconds, that a request remained unsent in the background thread."
            ),
            new Max()
        );

        this.backgroundEventQueueSizeSensor = metrics.sensor(BACKGROUND_EVENT_QUEUE_SIZE_SENSOR_NAME);
        this.backgroundEventQueueSizeSensor.add(
            metrics.metricName(
                BACKGROUND_EVENT_QUEUE_SIZE_SENSOR_NAME,
                CONSUMER_METRIC_GROUP,
                "The current number of events in the queue to send from the background thread to the application thread."
            ),
            new Value()
        );

        this.backgroundEventQueueTimeSensor = metrics.sensor(BACKGROUND_EVENT_QUEUE_TIME_SENSOR_NAME);
        this.backgroundEventQueueTimeSensor.add(
            metrics.metricName(
                "background-event-queue-time-avg",
                CONSUMER_METRIC_GROUP,
                "The average time, in milliseconds, that background events are taking to be dequeued."
            ),
            new Avg()
        );
        this.backgroundEventQueueTimeSensor.add(
            metrics.metricName(
                "background-event-queue-time-max",
                CONSUMER_METRIC_GROUP,
                "The maximum time, in milliseconds, that background events are taking to be dequeued."
            ),
            new Max()
        );

        this.backgroundEventQueueProcessingTimeSensor = metrics.sensor(BACKGROUND_EVENT_QUEUE_PROCESSING_TIME_SENSOR_NAME);
        this.backgroundEventQueueProcessingTimeSensor.add(
            metrics.metricName(
                "background-event-queue-processing-time-avg",
                CONSUMER_METRIC_GROUP,
                "The average time, in milliseconds, that the consumer took to process all available background events."
            ),
            new Avg()
        );
        this.backgroundEventQueueProcessingTimeSensor.add(
            metrics.metricName(
                "background-event-queue-processing-time-max",
                CONSUMER_METRIC_GROUP,
                "The maximum time, in milliseconds, that the consumer took to process all available background events."
            ),
            new Max()
        );
    }