sigram commented on code in PR #2244:
URL: https://github.com/apache/solr/pull/2244#discussion_r1489778608


##########
solr/core/src/java/org/apache/solr/handler/RequestHandlerBase.java:
##########
@@ -250,17 +253,17 @@ public void handleRequest(SolrQueryRequest req, 
SolrQueryResponse rsp) {
       long elapsed = timer.stop();
       metrics.totalTime.inc(elapsed);
 
-      if (cpuStats != null) {
-        Optional<Long> cpuTime = cpuStats.getCpuTimeMs();
+      if (publishCpuTime) {
+        Optional<Long> cpuTime = threadCpuTime.getCpuTimeMs();
         if (cpuTime.isPresent()) {
           // add CPU_TIME if not already added by SearchHandler
           NamedList<Object> header = rsp.getResponseHeader();

Review Comment:
   Yeah, I don't like this either. `ThreadCpuTimer.isSupported()` is the only 
condition for this to return false and it should be enough to check it.



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