コード例 #1
0
  private Object record(InvocationContext invocationContext, Method callback) throws Exception {
    invocations.incrementAndGet();

    Stats stats = enabled ? stats(invocationContext, callback) : null;
    long start = System.nanoTime();
    try {
      return invocationContext.proceed();
    } finally {
      long time = System.nanoTime() - start;
      time = millis(time); // do it in 2 steps since otherwise the measure is false (more false)
      if (stats != null) stats.record(time);
      invocationTime.addAndGet(time);
    }
  }