统计不统计

This commit is contained in:
2025-04-30 18:29:24 +08:00
parent 00f38c949c
commit 6197f13e8e

View File

@ -27,10 +27,10 @@ public class StatsInterceptor implements HandlerInterceptor {
if (!(handler instanceof HandlerMethod)) {
return true;
}
HandlerMethod handlerMethod = (HandlerMethod) handler;
request.setAttribute("startTime", System.currentTimeMillis());
String requestURI = request.getRequestURI();
String method = request.getMethod();
// HandlerMethod handlerMethod = (HandlerMethod) handler;
// request.setAttribute("startTime", System.currentTimeMillis());
// String requestURI = request.getRequestURI();
// String method = request.getMethod();
String traceId = request.getHeader("traceId");
if (StringUtils.isEmpty(traceId)) {
return true;
@ -38,9 +38,9 @@ public class StatsInterceptor implements HandlerInterceptor {
// response.setHeader("Set-TraceId", traceId);
// statsService.addStats(traceId, null);
}
if (handlerMethod.getMethodAnnotation(IgnoreLogReq.class) == null) {
statsService.addRecord(traceId, "REQUEST",method + " " + requestURI, null);
}
// if (handlerMethod.getMethodAnnotation(IgnoreLogReq.class) == null) {
// statsService.addRecord(traceId, "REQUEST",method + " " + requestURI, null);
// }
if (StringUtils.isNotEmpty(BaseContextHandler.getUserId())) {
statsService.updateStats(traceId, Long.valueOf(BaseContextHandler.getUserId()));
}