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 class
ResponseCollectorService.ComputedNodeStats
Struct-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 void
addNodeStatistics(java.lang.String nodeId, int queueSize, long responseTimeNanos, long avgServiceTimeNanos)
void
clusterChanged(ClusterChangedEvent event)
Called when cluster state changes.AdaptiveSelectionStats
getAdaptiveStats(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 aNodeStatistics
for the given nodeid, if response information exists for the given node.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ResponseCollectorService
-
-
Method Details
-
clusterChanged
Description copied from interface:ClusterStateListener
Called when cluster state changes.- Specified by:
clusterChanged
in 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 aNodeStatistics
for the given nodeid, if response information exists for the given node. Returns an emptyOptional
if the node was not found.
-