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


##########
clients/src/main/java/org/apache/kafka/common/metrics/stats/SampledStat.java:
##########
@@ -70,7 +72,7 @@ private Sample advance(MetricConfig config, long timeMs) {
     }
 
     protected Sample newSample(long timeMs) {
-        return new Sample(this.initialValue, timeMs);
+        return this.timeWindowMs != -1 ? new Sample(this.initialValue, timeMs) 
: new Sample(this.initialValue, timeMs, this.timeWindowMs);

Review Comment:
   Sorry, I mistakenly wrote the other way in the commit 
   ```suggestion
           return this.timeWindowMs > 0 ? new Sample(this.initialValue, timeMs, 
this.timeWindowMs) : new Sample(this.initialValue, timeMs);
   ```



##########
clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java:
##########
@@ -166,6 +166,10 @@ public String name() {
         return this.name;
     }
 
+    public MetricConfig metricConfig() {
+        return this.config;
+    }
+

Review Comment:
   This should not be required now.



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