Class ResponseCollectorService

  • All Implemented Interfaces:

    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 Detail

      • ResponseCollectorService

        public ResponseCollectorService​(ClusterService clusterService)
    • Method Detail

      • addNodeStatistics

        public void addNodeStatistics​(java.lang.String nodeId,
                                      int queueSize,
                                      long responseTimeNanos,
                                      long avgServiceTimeNanos)
      • 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.