Package org.opensearch.search.profile
Class ProfileResult
java.lang.Object
org.opensearch.search.profile.ProfileResult
- All Implemented Interfaces:
org.opensearch.core.common.io.stream.Writeable
,org.opensearch.core.xcontent.ToXContent
,org.opensearch.core.xcontent.ToXContentObject
@PublicApi(since="1.0.0")
public final class ProfileResult
extends Object
implements org.opensearch.core.common.io.stream.Writeable, org.opensearch.core.xcontent.ToXContentObject
This class is the internal representation of a profiled Query, corresponding
to a single node in the query tree. It is built after the query has finished executing
and is merely a structured representation, rather than the entity that collects the timing
profile (see InternalProfiler for that)
Each InternalProfileResult has a List of InternalProfileResults, which will contain "children" queries if applicable
- Opensearch.api:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable
org.opensearch.core.common.io.stream.Writeable.Reader<V>, org.opensearch.core.common.io.stream.Writeable.WriteableRegistry, org.opensearch.core.common.io.stream.Writeable.Writer<V>
-
Field Summary
Fields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescriptionProfileResult
(String type, String description, Map<String, Long> breakdown, Map<String, Object> debug, long nodeTime, List<ProfileResult> children) ProfileResult
(String type, String description, Map<String, Long> breakdown, Map<String, Object> debug, long nodeTime, List<ProfileResult> children, Long maxSliceNodeTime, Long minSliceNodeTime, Long avgSliceNodeTime) ProfileResult
(org.opensearch.core.common.io.stream.StreamInput in) Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProfileResult
fromXContent
(org.opensearch.core.xcontent.XContentParser p) The debug information about the profiled execution.Retrieve the lucene description of this query (e.g.Returns a list of all profiled children queriesRetrieve the name of the entry (e.g.long
getTime()
Returns the total time (inclusive of children) for this query node.The timing breakdown for this node.org.opensearch.core.xcontent.XContentBuilder
toXContent
(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) void
writeTo
(org.opensearch.core.common.io.stream.StreamOutput out) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opensearch.core.xcontent.ToXContentObject
isFragment
-
Constructor Details
-
ProfileResult
-
ProfileResult
-
ProfileResult
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
- Specified by:
writeTo
in interfaceorg.opensearch.core.common.io.stream.Writeable
- Throws:
IOException
-
getLuceneDescription
Retrieve the lucene description of this query (e.g. the "explain" text) -
getQueryName
Retrieve the name of the entry (e.g. "TermQuery" or "LongTermsAggregator") -
getTimeBreakdown
The timing breakdown for this node. -
getDebugInfo
The debug information about the profiled execution. -
getTime
public long getTime()Returns the total time (inclusive of children) for this query node.- Returns:
- elapsed time in nanoseconds
-
getMaxSliceTime
-
getMinSliceTime
-
getAvgSliceTime
-
getProfiledChildren
Returns a list of all profiled children queries -
toXContent
public org.opensearch.core.xcontent.XContentBuilder toXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceorg.opensearch.core.xcontent.ToXContent
- Throws:
IOException
-
fromXContent
public static ProfileResult fromXContent(org.opensearch.core.xcontent.XContentParser p) throws IOException - Throws:
IOException
-