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


##########
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:
   Changed.
   I assume that for worker metrics, would the datasource, interval, duration 
etc be based on the stages for which it has actually received work orders. Is 
that right?



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