gianm commented on code in PR #18121:
URL: https://github.com/apache/druid/pull/18121#discussion_r2162395198


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerImpl.java:
##########
@@ -220,9 +221,19 @@ public void run()
     }
     finally {
       runFuture.set(null);
+      reportCpuMetrics();
     }
   }
 
+  private void reportCpuMetrics()
+  {
+    long cpuTimeNs = 0L;
+    for (final CounterTracker tracker : stageCounters.values()) {
+      cpuTimeNs += tracker.totalCpu();
+    }
+    context.emitMetric("query/cpu/time", 
TimeUnit.NANOSECONDS.toMicros(cpuTimeNs));

Review Comment:
   For ease of correlating metrics across workers, let's have all workers 
compute these dimensions based on the overall query, even if they didn't 
process all stages. Later on we will want to add stage-specific metrics with 
stage-specific dimensions.



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