deniskuzZ commented on code in PR #6436:
URL: https://github.com/apache/hive/pull/6436#discussion_r3091752597


##########
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/metrics/LlapTaskSchedulerMetrics.java:
##########
@@ -102,10 +107,12 @@ private LlapTaskSchedulerMetrics(String displayName, 
JvmMetrics jm, String sessi
   }
 
   public static LlapTaskSchedulerMetrics create(String displayName, String 
sessionId) {
-    MetricsSystem ms = LlapMetricsSystem.instance();
-    JvmMetrics jm = JvmMetrics.create(MetricsUtils.METRICS_PROCESS_NAME, 
sessionId, ms);
-    return ms.register(displayName, "Llap Task Scheduler Metrics",
-        new LlapTaskSchedulerMetrics(displayName, jm, sessionId));
+    return INSTANCES.computeIfAbsent(displayName, name -> {

Review Comment:
   should it be unique per session?   String key = displayName + ":" + 
sessionId;
   
   ````
   public static LlapTaskSchedulerMetrics create(String displayName, String 
sessionId) {
     String key = displayName + ":" + sessionId;
   
     return METRICS.computeIfAbsent(key, k -> {
       MetricsSystem metricsSystem = LlapMetricsSystem.instance();
       JvmMetrics jvmMetrics =
           JvmMetrics.initSingleton(MetricsUtils.METRICS_PROCESS_NAME, 
sessionId);
   
       return metricsSystem.register(
           displayName,
           "Llap Task Scheduler Metrics",
           new LlapTaskSchedulerMetrics(displayName, jvmMetrics, sessionId));
     });
   }
   ````



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to