try {
return methodInvocation.proceed();
} finally {
long execTime = System.currentTimeMillis() - start;
final String methodID = methodNamingStrategy.getMethodAsString(currentMethod);
MethodInvocationStats methodInvocationStats = methodInvocationStatsMap.get(methodID);
if (methodInvocationStats == null) {
LOGGER.error("method is null : " + methodID);
throw new RuntimeException("Method with id : " + methodID + " not found in stats map : " + methodInvocationStatsMap.keySet());
}
if (methodInvocationStats.getHits().longValue() == -1l) {
methodInvocationStats.setHits(new AtomicLong(1));
methodInvocationStats.setLatestExecTime(new AtomicLong(execTime));
methodInvocationStats.setTotalExecTime(new AtomicLong(execTime));
methodInvocationStats.setMinExecTime(new AtomicLong(execTime));
methodInvocationStats.setMaxExecTime(new AtomicLong(execTime));
} else {
methodInvocationStats.getHits().incrementAndGet();
methodInvocationStats.getLatestExecTime().set(execTime);
methodInvocationStats.getTotalExecTime().addAndGet(methodInvocationStats.getLatestExecTime().get());
if (methodInvocationStats.getMaxExecTime().get() < execTime) {
methodInvocationStats.getMaxExecTime().set(execTime);
}
if (methodInvocationStats.getMinExecTime().get() > execTime) {
methodInvocationStats.getMinExecTime().set(execTime);
}
}
if (DEBUG) {
LOGGER.debug(new StringBuilder()