GWphua commented on PR #18744:
URL: https://github.com/apache/druid/pull/18744#issuecomment-3578807344

   Hi @aho135. Yes this PR is an attempt to do exactly what you described. But 
there's a catch that I missed -- The QueryMetrics are cleared after emission.
   
   One good example to look at is the Sequence object created in 
`CPUTimeMetricQueryRunner`:
   ```
   if (cpuTimeNs > 0) {
     responseContext.addCpuNanos(cpuTimeNs);
     queryWithMetrics.getQueryMetrics().reportCpuTime(cpuTimeNs).emit(emitter);
   }
   ```
   
   We will need to either 
   1. Report the GroupBy metrics directly in `emitLogsAndMetrics`, then emit 
after setting populating statsMap with metrics.
   2. Do not clear the metrics (Not sure about this, may cause metrics to 
double-report? Correct me if I'm wrong)


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