Module org.elasticsearch.server
Class SearchUsageStats
java.lang.Object
org.elasticsearch.action.admin.cluster.stats.SearchUsageStats
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentFragment
Holds a snapshot of the search usage statistics.
Used to hold the stats for a single node that's part of a
ClusterStatsNodeResponse, as well as to
accumulate stats for the entire cluster and return them as part of the ClusterStatsResponse.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty stats instance, that will get additional stats added throughadd(SearchUsageStats)SearchUsageStats(Map<String, Long> queries, Map<String, Long> rescorers, Map<String, Long> sections, Map<String, Long> retrievers, long totalSearchCount) Creates a new stats instance with the provided info. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(SearchUsageStats stats) Add the provided stats to the ones held by the current instance, effectively merging the twobooleanlonginthashCode()toString()toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
SearchUsageStats
public SearchUsageStats()Creates a new empty stats instance, that will get additional stats added throughadd(SearchUsageStats) -
SearchUsageStats
public SearchUsageStats(Map<String, Long> queries, Map<String, Long> rescorers, Map<String, Long> sections, Map<String, Long> retrievers, long totalSearchCount) Creates a new stats instance with the provided info. The expectation is that when a new instance is created using this constructor, the provided stats are final and won't be modified further. -
SearchUsageStats
- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
add
Add the provided stats to the ones held by the current instance, effectively merging the two -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
getQueryUsage
-
getRescorerUsage
-
getSectionsUsage
-
getRetrieversUsage
-
getTotalSearchCount
public long getTotalSearchCount() -
equals
-
hashCode
public int hashCode() -
toString
-