use of com.linkedin.cruisecontrol.servlet.EndPoint in project cruise-control by linkedin.
the class AbstractSyncRequest method getResponse.
@Override
public CruiseControlResponse getResponse(HttpServletRequest request, HttpServletResponse response) throws ExecutionException, InterruptedException {
LOG.info("Processing sync request {}.", name());
long requestExecutionStartTime = System.nanoTime();
int step = 0;
OperationFuture resultFuture = _userTaskManager.getOrCreateUserTask(request, response, uuid -> {
OperationFuture future = new OperationFuture(String.format("%s request", parameters().endPoint().toString()));
future.complete(handle());
return future;
}, step, false, parameters()).get(step);
CruiseControlResponse ccResponse = resultFuture.get();
_successfulRequestExecutionTimer.get(parameters().endPoint()).update(System.nanoTime() - requestExecutionStartTime, TimeUnit.NANOSECONDS);
return ccResponse;
}
Aggregations