agresch commented on a change in pull request #3307:
URL: https://github.com/apache/storm/pull/3307#discussion_r467268434



##########
File path: 
storm-client/src/jvm/org/apache/storm/metrics2/StormMetricRegistry.java
##########
@@ -153,9 +160,20 @@ public Histogram histogram(String name, TopologyContext 
context) {
         return histogram;
     }
 
+    public Histogram histogram(String name, String topologyId, String 
componentId, Integer taskId, Integer workerPort, String streamId) {
+        MetricNames metricNames = workerMetricName(name, topologyId, 
componentId, streamId, taskId, workerPort);
+        Histogram histogram = registry.histogram(metricNames.getLongName());
+        saveMetricTaskIdMapping(taskId, metricNames, histogram, 
taskIdHistograms);
+        return histogram;
+    }
+
     private static <T extends Metric> void saveMetricTaskIdMapping(Integer 
taskId, MetricNames names, T metric, Map<Integer,
             Map<String, T>> taskIdMetrics) {
         Map<String, T> metrics = taskIdMetrics.computeIfAbsent(taskId, (tid) 
-> new HashMap<>());
+        if (metrics.get(names.getV2TickName()) != null) {
+            LOG.warn("Adding duplicate short metric for " + 
names.getV2TickName()

Review comment:
       Only the last metric entered will report for the V2 metrics tick if this 
occurs.  I can update the message to indicate this.




----------------------------------------------------------------
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:
[email protected]


Reply via email to