apoorvmittal10 commented on code in PR #18232:
URL: https://github.com/apache/kafka/pull/18232#discussion_r1894344240


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchMetricsManager.java:
##########
@@ -181,6 +198,67 @@ void maybeUpdateAssignment(SubscriptionState subscription) 
{
         }
     }
 
+    @Deprecated // To be removed in Kafka 5.0 release.
+    private void maybeRecordDeprecatedBytesFetched(String name, String topic, 
int bytes) {
+        if (shouldReportDeprecatedMetric(topic)) {
+            Sensor deprecatedBytesFetched = new SensorBuilder(metrics, 
deprecatedMetricName(name), () -> topicTags(topic))
+                .withAvg(metricsRegistry.topicFetchSizeAvg)
+                .withMax(metricsRegistry.topicFetchSizeMax)
+                .withMeter(metricsRegistry.topicBytesConsumedRate, 
metricsRegistry.topicBytesConsumedTotal)
+                .build();
+            deprecatedBytesFetched.record(bytes);
+        }
+    }
+
+    @Deprecated // To be removed in Kafka 5.0 release.
+    private void maybeRecordDeprecatedRecordsFetched(String name, String 
topic, int records) {
+        if (shouldReportDeprecatedMetric(topic)) {
+            Sensor deprecatedRecordsFetched = new SensorBuilder(metrics, 
deprecatedMetricName(name), () -> topicTags(topic))
+                .withAvg(metricsRegistry.topicRecordsPerRequestAvg)
+                .withMeter(metricsRegistry.topicRecordsConsumedRate, 
metricsRegistry.topicRecordsConsumedTotal)
+                .build();
+            deprecatedRecordsFetched.record(records);
+        }
+    }
+
+    @Deprecated // To be removed in Kafka 5.0 release.
+    private void maybeRecordDeprecatedPartitionLag(String name, TopicPartition 
tp, long lag) {
+        if (shouldReportDeprecatedMetric(tp.topic())) {
+            Sensor deprecatedRecordsLag = new SensorBuilder(metrics, 
deprecatedMetricName(name), () -> topicPartitionTags(tp))
+                .withValue(metricsRegistry.partitionRecordsLag)
+                .withMax(metricsRegistry.partitionRecordsLagMax)
+                .withAvg(metricsRegistry.partitionRecordsLagAvg)
+                .build();
+
+            deprecatedRecordsLag.record(lag);
+        }
+    }
+
+    @Deprecated // To be removed in Kafka 5.0 release.

Review Comment:
   Done: https://issues.apache.org/jira/browse/KAFKA-18335



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to