jpountz commented on code in PR #14413:
URL: https://github.com/apache/lucene/pull/14413#discussion_r2031188700


##########
lucene/sandbox/src/java/org/apache/lucene/sandbox/search/QueryProfilerBreakdown.java:
##########
@@ -17,46 +17,113 @@
 
 package org.apache.lucene.sandbox.search;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import org.apache.lucene.search.Query;
 import org.apache.lucene.util.CollectionUtil;
 
 /**
  * A record of timings for the various operations that may happen during query 
execution. A node's
  * time may be composed of several internal attributes (rewriting, weighting, 
scoring, etc).
  */
 class QueryProfilerBreakdown {
-
-  /** The accumulated timings for this query node */
-  private final QueryProfilerTimer[] timers;
+  private static final Collection<QueryProfilerTimingType> 
QUERY_LEVEL_TIMING_TYPE =
+      Arrays.stream(QueryProfilerTimingType.values()).filter(t -> 
!t.isSliceLevel()).toList();
+  private final Map<QueryProfilerTimingType, QueryProfilerTimer> 
queryProfilerTimers;
+  private final ConcurrentMap<Long, QuerySliceProfilerBreakdown> 
threadToSliceBreakdown;

Review Comment:
   > if slice 1 and slice 2 are processed sequentially by thread A, it is 
actually better to aggregate that information as thread A breakdown instead of 
breakdown for slice 1 and slice 2. Thoughts?
   
   IMO both have merits, so if breaking down by thread is easier, I'm good with 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to