jtuglu1 commented on code in PR #18569:
URL: https://github.com/apache/druid/pull/18569#discussion_r2377948561


##########
server/src/test/java/org/apache/druid/server/metrics/QueryCountStatsMonitorTest.java:
##########
@@ -55,37 +56,57 @@ public void setUp()
 
     queryCountStatsProvider = new QueryCountStatsProvider()
     {
-      private long successEmitCount = 0;
-      private long failedEmitCount = 0;
-      private long interruptedEmitCount = 0;
-      private long timedOutEmitCount = 0;
+      private final AtomicLong successEmitCount = new AtomicLong(0);
+      private final AtomicLong failedEmitCount = new AtomicLong(0);
+      private final AtomicLong interruptedEmitCount = new AtomicLong(0);
+      private final AtomicLong timedOutEmitCount = new AtomicLong(0);
 
       @Override
       public long getSuccessfulQueryCount()
       {
-        successEmitCount += 1;
-        return successEmitCount;
+        return successEmitCount.get();
       }
 
       @Override
       public long getFailedQueryCount()
       {
-        failedEmitCount += 2;
-        return failedEmitCount;
+        return failedEmitCount.get();
       }
 
       @Override
       public long getInterruptedQueryCount()
       {
-        interruptedEmitCount += 3;
-        return interruptedEmitCount;
+        return interruptedEmitCount.get();
       }
 
       @Override
       public long getTimedOutQueryCount()
       {
-        timedOutEmitCount += 4;

Review Comment:
   No idea, I think to just add some variability so assertions were on some 
larger #s and so you don't need to do 4x calls.



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