use of com.yahoo.prelude.cluster.ClusterSearcher in project vespa by vespa-engine.
the class BackendStatistics method invoke.
public void invoke(Request request) {
try {
Collection<ClusterSearcher> searchers = clusterSearchers(request);
List<String> backendIdentificators = new ArrayList<>();
List<Integer> activeConnections = new ArrayList<>();
List<Integer> totalConnections = new ArrayList<>();
for (ClusterSearcher searcher : searchers) {
for (Map.Entry<String, Backend.BackendStatistics> statistics : searcher.getBackendStatistics().entrySet()) {
backendIdentificators.add(statistics.getKey());
activeConnections.add(statistics.getValue().activeConnections);
totalConnections.add(statistics.getValue().totalConnections());
}
}
Values returnValues = request.returnValues();
returnValues.add(new StringArray(backendIdentificators.toArray(new String[0])));
addInt32Array(returnValues, activeConnections);
addInt32Array(returnValues, totalConnections);
} catch (Exception e) {
request.setError(1000, Exceptions.toMessageString(e));
}
}
use of com.yahoo.prelude.cluster.ClusterSearcher in project vespa by vespa-engine.
the class TracePackets method invoke.
public void invoke(Request request) {
try {
Collection<ClusterSearcher> searchers = clusterSearchers(request);
boolean on = request.parameters().get(1).asInt8() != 0;
for (ClusterSearcher searcher : searchers) searcher.dumpPackets(packetType, on);
} catch (Exception e) {
request.setError(1000, Exceptions.toMessageString(e));
}
}
Aggregations