vamossagar12 commented on code in PR #12121:
URL: https://github.com/apache/kafka/pull/12121#discussion_r876158002


##########
clients/src/main/java/org/apache/kafka/common/metrics/Metrics.java:
##########
@@ -524,6 +524,58 @@ public void addMetric(MetricName metricName, 
MetricValueProvider<?> metricValueP
         addMetric(metricName, null, metricValueProvider);
     }
 
+    /**
+     * Create or get an existing metric to monitor an object that implements 
Measurable.
+     * This metric won't be associated with any sensor. This is a way to 
expose existing values as metrics.
+     *
+     * This method is kept for binary compatibility purposes, it has the same 
behaviour as
+     * {@link #metricOrElseCreate(MetricName, MetricConfig, 
MetricValueProvider)}.
+     *
+     * @param metricName The name of the metric
+     * @param config The configuration to use when measuring this measurable
+     * @param measurable The measurable that will be measured by this metric
+     * @return Existing KafkaMetric if already registered or else a newly 
created one
+     */
+    public KafkaMetric metricOrElseCreate(MetricName metricName, MetricConfig 
config, Measurable measurable) {

Review Comment:
   I removed the other 2. I had added them to be at par with the addMetric 
method and it's overloads.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to