chia7712 commented on code in PR #20543:
URL: https://github.com/apache/kafka/pull/20543#discussion_r2354844293


##########
clients/src/main/java/org/apache/kafka/common/metrics/KafkaMetric.java:
##########
@@ -75,12 +75,7 @@ public MetricName metricName() {
     public Object metricValue() {
         long now = time.milliseconds();
         synchronized (this.lock) {
-            if (isMeasurable())
-                return ((Measurable) metricValueProvider).measure(config, now);
-            else if (this.metricValueProvider instanceof Gauge)
-                return ((Gauge<?>) metricValueProvider).value(config, now);
-            else
-                throw new IllegalStateException("Not a valid metric: " + 
this.metricValueProvider.getClass());
+            return metricValueProvider.value(config, now);

Review Comment:
   Can we update the docs so they match these changes?



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