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.
  • Constructor Details

    • ResponseCollectorService

      public ResponseCollectorService​(ClusterService clusterService)
  • Method Details

    • clusterChanged

      public void clusterChanged​(ClusterChangedEvent event)
      Description copied from interface: ClusterStateListener
      Called when cluster state changes.
      Specified by:
      clusterChanged in interface ClusterStateListener
    • 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 a NodeStatistics for the given nodeid, if response information exists for the given node. Returns an empty Optional if the node was not found.