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


##########
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();
           if (header != null) {
-            if (header.get(ThreadStats.CPU_TIME) == null) {
-              header.add(ThreadStats.CPU_TIME, cpuTime.get());
+            if (header.get(ThreadCpuTime.CPU_TIME) == null) {

Review Comment:
   I believe the idea was to make sure the total CPU time is added to response 
from any handler, not just the `SearchHandler` where it's calculated 
differently as a sum of per-shard times.



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