use of build.buildfarm.v1test.GetClientStartTimeRequest in project bazel-buildfarm by bazelbuild.
the class AdminServiceImpl method getAllContainersUptime.
private Map<String, Long> getAllContainersUptime(List<String> hostNames) {
ManagedChannel channel = ManagedChannelBuilder.forAddress(deploymentDomain, deploymentPort).usePlaintext().build();
AdminGrpc.AdminBlockingStub stub = AdminGrpc.newBlockingStub(channel);
GetClientStartTimeRequest request = GetClientStartTimeRequest.newBuilder().setInstanceName("shard").addAllHostName(hostNames).build();
GetClientStartTimeResult result = stub.getClientStartTime(request);
Map<String, Long> allContainersUptime = new HashMap<String, Long>();
for (GetClientStartTime GetClientStartTime : result.getClientStartTimeList()) {
allContainersUptime.put(GetClientStartTime.getInstanceName(), GetClientStartTime.getClientStartTime().getSeconds());
}
if (channel != null) {
channel.shutdown();
}
return allContainersUptime;
}
Aggregations