private static final TraceRegistry TRACEREGISTRY = TraceRegistry.INSTANCE; @SyntheticLocal private static boolean newTrace; @SyntheticLocal private static long traceId; @SyntheticLocal private static String signature; @SyntheticLocal private static String clazz; @SyntheticLocal private static TraceMetadata trace;
@AfterReturning(marker = BodyMarker.class, scope = "") public static void onMethodExit(final MethodStaticContext msc) { if (!CTRLINST.isMonitoringEnabled() || !CTRLINST.isProbeActivated(signature)) { return; } if (newTrace) { // close the trace TRACEREGISTRY.unregisterTrace(); } // measure after successful execution CTRLINST.newMonitoringRecord(new AfterOperationEvent(TIME.getTime(), traceId, trace.getNextOrderId(), signature, clazz)); }
@AfterThrowing(marker = BodyMarker.class, scope = "") public static void onMethodException(final MethodStaticContext msc, final DynamicContext dc) { if (!CTRLINST.isMonitoringEnabled() || !CTRLINST.isProbeActivated(signature)) { return; } if (newTrace) { // close the trace TRACEREGISTRY.unregisterTrace(); } // measure after failed execution CTRLINST.newMonitoringRecord(new AfterOperationFailedEvent(TIME.getTime(), traceId, trace.getNextOrderId(), signature, clazz, dc.getException().toString())); } }
@Before(marker = BodyMarker.class, scope = "") public static void onMethodEntry(final MethodStaticContext msc, final DynamicContext dc) { if (!CTRLINST.isMonitoringEnabled()) { return; } signature = msc.thisMethodFullName(); if (!CTRLINST.isProbeActivated(signature)) { return; } // common fields trace = TRACEREGISTRY.getTrace(); newTrace = trace == null; if (newTrace) { trace = TRACEREGISTRY.registerTrace(); CTRLINST.newMonitoringRecord(trace); } traceId = trace.getTraceId(); clazz = dc.getThis().getClass().toString(); // measure before execution CTRLINST.newMonitoringRecord(new BeforeOperationEvent(TIME.getTime(), traceId, trace.getNextOrderId(), signature, clazz)); }
private static final TraceRegistry TRACEREGISTRY = TraceRegistry.INSTANCE; @SyntheticLocal private static boolean newTrace; @SyntheticLocal private static long traceId; @SyntheticLocal private static String signature; @SyntheticLocal private static String clazz; @SyntheticLocal private static TraceMetadata trace;
@AfterReturning(marker = BodyMarker.class, scope = "") public static void onMethodExit(final MethodStaticContext msc) { if (!CTRLINST.isMonitoringEnabled() || !CTRLINST.isProbeActivated(signature)) { return; } if (newTrace) { // close the trace TRACEREGISTRY.unregisterTrace(); } // measure after successful execution CTRLINST.newMonitoringRecord(new AfterOperationEvent(TIME.getTime(), traceId, trace.getNextOrderId(), signature, clazz)); }
@AfterThrowing(marker = BodyMarker.class, scope = "") public static void onMethodException(final MethodStaticContext msc, final DynamicContext dc) { if (!CTRLINST.isMonitoringEnabled() || !CTRLINST.isProbeActivated(signature)) { return; } if (newTrace) { // close the trace TRACEREGISTRY.unregisterTrace(); } // measure after failed execution CTRLINST.newMonitoringRecord(new AfterOperationFailedEvent(TIME.getTime(), traceId, trace.getNextOrderId(), signature, clazz, dc.getException().toString())); } }
@Before(marker = BodyMarker.class, scope = "") public static void onMethodEntry(final MethodStaticContext msc, final DynamicContext dc) { if (!CTRLINST.isMonitoringEnabled()) { return; } signature = msc.thisMethodFullName(); if (!CTRLINST.isProbeActivated(signature)) { return; } // common fields trace = TRACEREGISTRY.getTrace(); newTrace = trace == null; if (newTrace) { trace = TRACEREGISTRY.registerTrace(); CTRLINST.newMonitoringRecord(trace); } traceId = trace.getTraceId(); clazz = dc.getThis().getClass().toString(); // measure before execution CTRLINST.newMonitoringRecord(new BeforeOperationEvent(TIME.getTime(), traceId, trace.getNextOrderId(), signature, clazz)); }