Package org.elasticsearch.search.profile
Class ProfileResult
java.lang.Object
org.elasticsearch.search.profile.ProfileResult
- All Implemented Interfaces:
Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
public final class ProfileResult extends java.lang.Object implements Writeable, org.elasticsearch.common.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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ProfileResult(java.lang.String type, java.lang.String description, java.util.Map<java.lang.String,java.lang.Long> breakdown, java.util.Map<java.lang.String,java.lang.Object> debug, long nodeTime, java.util.List<ProfileResult> children)
ProfileResult(StreamInput in)
Read from a stream. -
Method Summary
Modifier and Type Method Description static ProfileResult
fromXContent(org.elasticsearch.common.xcontent.XContentParser p)
java.util.Map<java.lang.String,java.lang.Object>
getDebugInfo()
The debug information about the profiled execution.java.lang.String
getLuceneDescription()
Retrieve the lucene description of this query (e.g.java.util.List<ProfileResult>
getProfiledChildren()
Returns a list of all profiled children queriesjava.lang.String
getQueryName()
Retrieve the name of the entry (e.g.long
getTime()
Returns the total time (inclusive of children) for this query node.java.util.Map<java.lang.String,java.lang.Long>
getTimeBreakdown()
The timing breakdown for this node.org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.
-
Constructor Details
-
ProfileResult
public ProfileResult(java.lang.String type, java.lang.String description, java.util.Map<java.lang.String,java.lang.Long> breakdown, java.util.Map<java.lang.String,java.lang.Object> debug, long nodeTime, java.util.List<ProfileResult> children) -
ProfileResult
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput. -
getLuceneDescription
public java.lang.String getLuceneDescription()Retrieve the lucene description of this query (e.g. the "explain" text) -
getQueryName
public java.lang.String getQueryName()Retrieve the name of the entry (e.g. "TermQuery" or "LongTermsAggregator") -
getTimeBreakdown
public java.util.Map<java.lang.String,java.lang.Long> getTimeBreakdown()The timing breakdown for this node. -
getDebugInfo
public java.util.Map<java.lang.String,java.lang.Object> 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
-
getProfiledChildren
Returns a list of all profiled children queries -
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
java.io.IOException
-
fromXContent
public static ProfileResult fromXContent(org.elasticsearch.common.xcontent.XContentParser p) throws java.io.IOException- Throws:
java.io.IOException
-