use of org.apache.zookeeper.server.Request in project incubator-pulsar by apache.
the class FinalRequestProcessorAspect method timedProcessRequest.
@Around("processRequest()")
public void timedProcessRequest(ProceedingJoinPoint joinPoint) throws Throwable {
joinPoint.proceed();
Request request = (Request) joinPoint.getArgs()[0];
String type = requestTypeMap.getOrDefault(request.type, "unknown");
requests.labels(type).inc();
long latencyMs = System.currentTimeMillis() - request.createTime;
String latencyLabel = isWriteRequest(request.type) ? "write" : "read";
requestsLatency.labels(latencyLabel).observe(latencyMs);
}
Aggregations