siddharthteotia commented on a change in pull request #6680:
URL: https://github.com/apache/incubator-pinot/pull/6680#discussion_r595615814



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/operator/combine/BaseCombineOperator.java
##########
@@ -89,12 +92,28 @@ protected IntermediateResultsBlock getNextBlock() {
       _futures[i] = _executorService.submit(new TraceRunnable() {
         @Override
         public void runJob() {
+          ThreadTimer processThreadTimer = new ThreadTimer();
+          processThreadTimer.start();
+
           processSegments(threadIndex);
+
+          processThreadTimer.stop();
+          totalWorkerTime.addAndGet(processThreadTimer.getThreadTime());
         }
       });
     }
 
+    ThreadTimer mergeThreadTimer = new ThreadTimer();

Review comment:
       As discussed offline, we should move all the single threaded 
instrumentation to InstanceResponseOperator
   
   ```
    @Override
     protected InstanceResponseBlock getNextBlock() {
       ThreadTimer mainThreadTimer = new ThreadTimer();
      
       mainThreadTimer.start();
   
       IntermediateResultsBlock intermediateResultsBlock = 
(IntermediateResultsBlock) _operator.nextBlock();
       InstanceResponseBlock instanceResponseBlock = new 
InstanceResponseBlock(intermediateResultsBlock);
       DataTable dataTable = 
instanceResponseBlock.getInstanceResponseDataTable();
      
       mainThreadTimer.stop();
      
       long totalThreadCpuTimeNs = 
intermediateResultsBlock.getThreadCpuTimeNs() + 
mainThreadTimer.getThreadTimeNs();
      
       dataTable.getMetadata().put(DataTable.THREAD_CPU_TIME_NS_METADATA_KEY, 
String.valueOf(totalThreadCpuTimeNs));
   
       return instanceResponseBlock
     }
   ```
   
   This way all single threaded query execution (except for planning) code's 
cpu time is covered without having to do it in multiple places. 




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to