Akshat-Jain commented on code in PR #17170:
URL: https://github.com/apache/druid/pull/17170#discussion_r1877525509


##########
processing/src/main/java/org/apache/druid/java/util/emitter/service/ServiceMetricEvent.java:
##########
@@ -197,7 +198,7 @@ public ServiceMetricEvent build(ImmutableMap<String, 
String> serviceDimensions)
       return new ServiceMetricEvent(
           createdTime,
           serviceDimensions,
-          userDims,
+          new HashMap<>(userDims),

Review Comment:
   I see that `StreamAppenderatorTest#testQueryByIntervals` fails if we 
directly pass `userDims`.
   
   My best rationale so far is that this change is only needed because the test 
uses `StubServiceEmitter`, hence the previously stored metrics don't actually 
get emitted anywhere, and the previously stored metrics end up getting mutated 
because they use the same `userDims`.
   
   @findingrish Can you confirm if this is the reason, and this is done only 
for test purposes, and directly passing `userDims` should work for any real 
world scenarios?
   
   Please let me know if I'm missing some other aspect of this change. 
Appreciate your inputs, thanks!



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