You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "jtuglu1 (via GitHub)" <gi...@apache.org> on 2025/12/23 16:11:11 UTC
Re: [PR] Emit missing `ingest/merge/time`, `ingest/merge/cpu` and `ingest/persists/cpu` metrics (druid)
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org