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


##########
server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:
##########
@@ -748,14 +750,15 @@ public Object call() throws IOException
             }
             finally {
               metrics.incrementNumPersists();

Review Comment:
   nit: can we move the increments below the time-sensitive metric emissions? 
Given we are reporting at nano-scale, chance of interrupt and/or delay due to 
atomic load+store can skew the nano count by X-XXns.



##########
server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:
##########
@@ -991,8 +998,8 @@ private DataSegmentWithMetadata mergeAndPush(
           identifier,
           segment.getSize(),
           indexes.size(),
-          (mergeFinishTime - startTime) / 1000000,

Review Comment:
   👍 We should probably make sure this is not being done elsewhere. For future 
readers, `System.nanoTime()` is actually more expensive than 
`System.getCurrentTimeMillis()` so if you need milli-level precision, just use 
the latter from the start.



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