Package org.elasticsearch.node
Class ResponseCollectorService
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.node.ResponseCollectorService
-
- All Implemented Interfaces:
ClusterStateListener
public final class ResponseCollectorService extends AbstractComponent 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.
-
Field Summary
-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
deprecationLogger, logger, settings
-
-
Constructor Summary
Constructors Constructor Description ResponseCollectorService(Settings settings, ClusterService clusterService)
-
Method Summary
All Methods Instance Methods Concrete Methods 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 org.elasticsearch.common.component.AbstractComponent
nodeName
-
-
-
-
Constructor Detail
-
ResponseCollectorService
public ResponseCollectorService(Settings settings, ClusterService clusterService)
-
-
Method Detail
-
clusterChanged
public void clusterChanged(ClusterChangedEvent event)
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.
-
-