java.lang.Object
org.elasticsearch.search.profile.AbstractProfiler<QueryProfileBreakdown,org.apache.lucene.search.Query>
org.elasticsearch.search.profile.query.QueryProfiler
public final class QueryProfiler
extends AbstractProfiler<QueryProfileBreakdown,org.apache.lucene.search.Query>
This class acts as a thread-local storage for profiling a query. It also
builds a representation of the query tree which is built constructed
"online" as the weights are wrapped by ContextIndexSearcher. This allows us
to know the relationship between nodes in tree without explicitly
walking the tree or pre-wrapping everything
A Profiler is associated with every Search, not per Search-Request. E.g. a
request may execute two searches (query + global agg). A Profiler just
represents one of those
-
Field Summary
Fields inherited from class org.elasticsearch.search.profile.AbstractProfiler
profileTree
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the current root Collector for this searchlong
long
void
setCollectorResult
(CollectorResult collectorResult) Set the collector result that is associated with this profiler.void
setVectorOpsCount
(long vectorOpsCount) Begin timing the rewrite phase of a request.long
stopAndAddRewriteTime
(Timer rewriteTimer) Stop recording the current rewrite and add it's time to the total tally, returning the cumulative time so far.Methods inherited from class org.elasticsearch.search.profile.AbstractProfiler
getQueryBreakdown, getTree, pollLastElement
-
Constructor Details
-
QueryProfiler
public QueryProfiler()
-
-
Method Details
-
setVectorOpsCount
public void setVectorOpsCount(long vectorOpsCount) -
getVectorOpsCount
public long getVectorOpsCount() -
setCollectorResult
Set the collector result that is associated with this profiler. -
startRewriteTime
Begin timing the rewrite phase of a request. All rewrites are accumulated together into a single metric -
stopAndAddRewriteTime
Stop recording the current rewrite and add it's time to the total tally, returning the cumulative time so far.- Returns:
- cumulative rewrite time
-
getRewriteTime
public long getRewriteTime()- Returns:
- total time taken to rewrite all queries in this profile
-
getCollectorResult
Return the current root Collector for this search
-