gwenshap commented on a change in pull request #9249:
URL: https://github.com/apache/kafka/pull/9249#discussion_r484602439



##########
File path: clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java
##########
@@ -324,11 +332,35 @@ public synchronized boolean add(final MetricName 
metricName, final MeasurableSta
             );
             registry.registerMetric(metric);
             metrics.put(metric.metricName(), metric);
-            stats.add(new StatAndConfig(Objects.requireNonNull(stat), 
statConfig));
+            stats.add(new StatAndConfig(Objects.requireNonNull(stat), 
statConfig, metricName));
             return true;
         }
     }
 
+    /**
+     * Update config of a measurable stat and metric registered with this 
sensor that corresponds to a given metric name
+     * @param metricName The name of the metric to update
+     * @param config     New configuration for this metric
+     * @return true if config was updated, false if sensor expired or metric 
is not registered with the sensor
+     */
+    public synchronized boolean update(final MetricName metricName, final 
MetricConfig config) {

Review comment:
       nit: The method signature for StatAndConfig has MetricConfig parameter 
first and MetricName second. This one has the reverse order.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to