vrajat commented on code in PR #15069:
URL: https://github.com/apache/pinot/pull/15069#discussion_r1957085491


##########
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:
   We will also need the operator type to detect an uninstrumented path. I'll 
add that in a different PR. I am keeping this PR simple to get approval in a 
short period of time.



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

Reply via email to