vrajat commented on code in PR #15069: URL: https://github.com/apache/pinot/pull/15069#discussion_r1957085311
########## pinot-core/src/main/java/org/apache/pinot/core/accounting/PerQueryCPUMemAccountantFactory.java: ########## @@ -278,8 +278,9 @@ public void updateQueryUsageConcurrently(String queryId) { */ @SuppressWarnings("ConstantConditions") public void sampleThreadCPUTime() { - if (_isThreadCPUSamplingEnabled) { - _threadLocalEntry.get()._currentThreadCPUTimeSampleMS = getThreadResourceUsageProvider().getThreadTimeNs(); + ThreadResourceUsageProvider provider = getThreadResourceUsageProvider(); + if (_isThreadCPUSamplingEnabled && provider != null) { + _threadLocalEntry.get()._currentThreadCPUTimeSampleMS = provider.getThreadTimeNs(); Review Comment: I thought about that or in some way detect an uninstrumented path. One issue is that this fn. is called for every block of data in every operator. So warn logs can potentially fill up log files. Another point - the memory used will be -1 if not instrumented. So this should be good enough _if_ data collection is available. -- 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: commits-unsubscr...@pinot.apache.org 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