Package org.elasticsearch.node
Class ResponseCollectorService
- java.lang.Object
-
- org.elasticsearch.node.ResponseCollectorService
-
- All Implemented Interfaces:
ClusterStateListener
public final class ResponseCollectorService extends java.lang.Object implements ClusterStateListener
Collects statistics about queue size, response time, and service time of tasks executed on each node, making the EWMA of the values available to the coordinating node.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classResponseCollectorService.ComputedNodeStatsStruct-like class encapsulating a point-in-time snapshot of a particular node's statistics.
-
Constructor Summary
Constructors Constructor Description ResponseCollectorService(ClusterService clusterService)
-
Method Summary
Modifier and Type Method Description voidaddNodeStatistics(java.lang.String nodeId, int queueSize, long responseTimeNanos, long avgServiceTimeNanos)voidclusterChanged(ClusterChangedEvent event)Called when cluster state changes.AdaptiveSelectionStatsgetAdaptiveStats(java.util.Map<java.lang.String,java.lang.Long> clientSearchConnections)java.util.Map<java.lang.String,ResponseCollectorService.ComputedNodeStats>getAllNodeStatistics()java.util.Optional<ResponseCollectorService.ComputedNodeStats>getNodeStatistics(java.lang.String nodeId)Optionally return aNodeStatisticsfor the given nodeid, if response information exists for the given node.
-
-
-
Constructor Detail
-
ResponseCollectorService
public ResponseCollectorService(ClusterService clusterService)
-
-
Method Detail
-
clusterChanged
public void clusterChanged(ClusterChangedEvent event)
Description copied from interface:ClusterStateListenerCalled when cluster state changes.- Specified by:
clusterChangedin interfaceClusterStateListener
-
addNodeStatistics
public void addNodeStatistics(java.lang.String nodeId, int queueSize, long responseTimeNanos, long avgServiceTimeNanos)
-
getAllNodeStatistics
public java.util.Map<java.lang.String,ResponseCollectorService.ComputedNodeStats> getAllNodeStatistics()
-
getAdaptiveStats
public AdaptiveSelectionStats getAdaptiveStats(java.util.Map<java.lang.String,java.lang.Long> clientSearchConnections)
-
getNodeStatistics
public java.util.Optional<ResponseCollectorService.ComputedNodeStats> getNodeStatistics(java.lang.String nodeId)
Optionally return aNodeStatisticsfor the given nodeid, if response information exists for the given node. Returns an emptyOptionalif the node was not found.
-
-