/** * Wraps the invocation with a JAMon Monitor and writes the current * performance statistics to the log (if enabled). * @see com.jamonapi.MonitorFactory#start * @see com.jamonapi.Monitor#stop */ @Override protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable { String name = createInvocationTraceName(invocation); MonKey key = new MonKeyImp(name, name, "ms."); Monitor monitor = MonitorFactory.start(key); try { return invocation.proceed(); } catch (Throwable ex) { trackException(key, ex); throw ex; } finally { monitor.stop(); if (!this.trackAllInvocations || isLogEnabled(logger)) { writeToLog(logger, "JAMon performance statistics for method [" + name + "]:\n" + monitor); } } }
protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable { String name = createInvocationTraceName(invocation); Monitor monitor = MonitorFactory.start(name); try { return invocation.proceed(); } finally { monitor.stop(); logger.trace("JAMon performance statistics for method [" + name + "]:\n" + monitor); } }
/** * Wraps the invocation with a JAMon Monitor and writes the current * performance statistics to the log (if enabled). * @see com.jamonapi.MonitorFactory#start * @see com.jamonapi.Monitor#stop */ @Override protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable { String name = createInvocationTraceName(invocation); MonKey key = new MonKeyImp(name, name, "ms."); Monitor monitor = MonitorFactory.start(key); try { return invocation.proceed(); } catch (Throwable ex) { trackException(key, ex); throw ex; } finally { monitor.stop(); if (!this.trackAllInvocations || isLogEnabled(logger)) { writeToLog(logger, "JAMon performance statistics for method [" + name + "]:\n" + monitor); } } }
/** * Wraps the invocation with a JAMon Monitor and writes the current * performance statistics to the log (if enabled). * @see com.jamonapi.MonitorFactory#start * @see com.jamonapi.Monitor#stop */ @Override protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable { String name = createInvocationTraceName(invocation); MonKey key = new MonKeyImp(name, name, "ms."); Monitor monitor = MonitorFactory.start(key); try { return invocation.proceed(); } catch (Throwable ex) { trackException(key, ex); throw ex; } finally { monitor.stop(); if (!this.trackAllInvocations || isLogEnabled(logger)) { writeToLog(logger, "JAMon performance statistics for method [" + name + "]:\n" + monitor); } } }