ArunParthiban-ST commented on a change in pull request #9659:
URL: https://github.com/apache/kafka/pull/9659#discussion_r532128042



##########
File path: 
clients/src/main/java/org/apache/kafka/common/metrics/internals/MetricsUtils.java
##########
@@ -43,4 +47,20 @@ public static double convert(long timeMs, TimeUnit unit) {
                 throw new IllegalStateException("Unknown unit: " + unit);
         }
     }
+
+    /**
+     * Create a set of tags using the supplied key and value pairs. The order 
of the tags will be kept.
+     *
+     * @param keyValue the key and value pairs for the tags; must be an even 
number
+     * @return the map of tags that can be supplied to the {@link Metrics} 
methods; never null
+     */
+    public static Map<String, String> getTags(String... keyValue) {
+        if ((keyValue.length % 2) != 0)
+            throw new IllegalArgumentException("keyValue needs to be specified 
in pairs");
+        Map<String, String> tags = new LinkedHashMap<>();

Review comment:
       Sure! 




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