jpountz commented on code in PR #14413: URL: https://github.com/apache/lucene/pull/14413#discussion_r2028458611
########## 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: There seems to be a general problem with how profiling figures out which slice it runs in. We should look into reliably identifying slices, or breaking down by thread rather than by slice? -- 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