code: @Override
      public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
          String requestURI = getRequestURI(requestContext);
          if (isExclusion(requestURI) || WebRequestStat.current() == null) {
              return;
          }
          long endNano = System.nanoTime();
          WebRequestStat.current().setEndNano(endNano);
  
          long nanos = endNano - WebRequestStat.current().getStartNano();
  
          Throwable error = null;
  
          if (responseContext.getStatus() == Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()) {
              if (Throwable.class.isInstance(responseContext.getEntity()))
                  error = (Throwable) responseContext.getEntity();
          }
  
          webAppStat.afterInvoke(error, nanos);
          WebURIStat uriStat = getUriStat(requestURI);
  
          if (uriStat == null) {
              int status = responseContext.getStatus();
              if (status == Response.Status.NOT_FOUND.getStatusCode()) {
                  String errorUrl = contextPath + "error_" + status;
                  uriStat = webAppStat.getURIStat(errorUrl, true);
              } else {
                  uriStat = webAppStat.getURIStat(requestURI, true);
              }
  
              if (uriStat != null) {
                  uriStat.beforeInvoke(); // 补偿调用
              }
          }
  
          if (uriStat != null) {
              uriStat.afterInvoke(error, nanos);
          }
  
          WebRequestStat.set(null);
  
          if (isProfileEnable()) {
              Profiler.release(nanos);
  
              Map<ProfileEntryKey, ProfileEntryReqStat> requestStatsMap = Profiler.getStatsMap();
              if (uriStat != null) {
                  uriStat.getProfiletat().record(requestStatsMap);
              }
              Profiler.removeLocal();
          }
      }
docs: {@inheritDoc}