public final class ResponseCollectorService extends AbstractComponent implements ClusterStateListener
Modifier and Type | Class and Description |
---|---|
static class |
ResponseCollectorService.ComputedNodeStats
Struct-like class encapsulating a point-in-time snapshot of a particular
node's statistics.
|
deprecationLogger, logger, settings
Constructor and Description |
---|
ResponseCollectorService(Settings settings,
ClusterService clusterService) |
Modifier and Type | Method and 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 a
NodeStatistics for the given nodeid, if
response information exists for the given node. |
logDeprecatedSetting, logRemovedSetting, nodeName
public ResponseCollectorService(Settings settings, ClusterService clusterService)
public void clusterChanged(ClusterChangedEvent event)
ClusterStateListener
clusterChanged
in interface ClusterStateListener
public void addNodeStatistics(java.lang.String nodeId, int queueSize, long responseTimeNanos, long avgServiceTimeNanos)
public java.util.Map<java.lang.String,ResponseCollectorService.ComputedNodeStats> getAllNodeStatistics()
public AdaptiveSelectionStats getAdaptiveStats(java.util.Map<java.lang.String,java.lang.Long> clientSearchConnections)
public java.util.Optional<ResponseCollectorService.ComputedNodeStats> getNodeStatistics(java.lang.String nodeId)
NodeStatistics
for the given nodeid, if
response information exists for the given node. Returns an empty
Optional
if the node was not found.