siddharthteotia commented on a change in pull request #6886: URL: https://github.com/apache/incubator-pinot/pull/6886#discussion_r628638182
########## File path: pinot-core/src/main/java/org/apache/pinot/core/operator/InstanceResponseOperator.java ########## @@ -45,8 +46,39 @@ protected InstanceResponseBlock getNextBlock() { DataTable dataTable = instanceResponseBlock.getInstanceResponseDataTable(); mainThreadTimer.stop(); - long totalThreadCpuTimeNs = - intermediateResultsBlock.getExecutionThreadCpuTimeNs() + mainThreadTimer.getThreadTimeNs(); + long endWallClockTimeNs = System.nanoTime(); + + long singleThreadCpuTimeNs = mainThreadTimer.getThreadTimeNs(); + long multipleThreadCpuTimeNs = intermediateResultsBlock.getExecutionThreadCpuTimeNs(); + long totalThreadCpuTimeNs = singleThreadCpuTimeNs + multipleThreadCpuTimeNs; + long totalWallClockTimeNs = endWallClockTimeNs - startWallClockTimeNs; Review comment: @mqliang, based on our latest discussion, let's use the wall clock time from the time query started execution (the query main thread was put on CPU). To be precise, this happens at line 118 in processQuery() method in [ServerQueryExecutorV1Impl](https://github.com/apache/incubator-pinot/blob/master/pinot-core/src/main/java/org/apache/pinot/core/query/executor/ServerQueryExecutorV1Impl.java#L118). If we take the absolute wall clock time (the one measured in QueryScheduler right from the time query was arrived on the server), then we will also be accounting for queue wait that happened due to QPS etc which we don't want part of query cpu time. Confirmed with @mcvsubbu and he is also aligned with this. -- 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