use of build.buildfarm.v1test.GetClientStartTimeResult in project bazel-buildfarm by bazelbuild.
the class AdminService method getClientStartTime.
@Override
public void getClientStartTime(GetClientStartTimeRequest request, StreamObserver<GetClientStartTimeResult> responseObserver) {
try {
GetClientStartTimeResult result = instance.getClientStartTime(request);
responseObserver.onNext(result);
responseObserver.onCompleted();
} catch (Exception e) {
logger.log(Level.SEVERE, String.format("Could not get client start time for %s.", request.getInstanceName()), e);
responseObserver.onError(io.grpc.Status.fromThrowable(e).asException());
}
}
use of build.buildfarm.v1test.GetClientStartTimeResult 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