@SuppressWarnings("unchecked") static Map<OperationType, CounterHolder> getCounterMap(FrameBuilder builder) { return builder.getHint(COUNTER_MAP_HINT, Map.class); }
@SuppressWarnings("unchecked") static LinkedList<StopWatchHolder> getStopWatchStack(FrameBuilder builder) { return builder.getHint(COUNTER_STACK_HINT, LinkedList.class); }
/** * Return <code>true</code> if the current trace is aborted * * @param builder current builder * @return <code>true</code> if the current trace is aborted, <code>false</code> otherwise */ protected static final boolean isAborted(FrameBuilder builder) { Boolean hint = builder.getHint(FrameBuilder.HINT_ABORTED, Boolean.class); return hint != null && hint.booleanValue(); }
public final boolean collect(CollectionAspectProperties aspect, JoinPoint.StaticPart ignored) { if (aspect.isMetricsGenerator()) { return true; } // check hint Boolean hint = frameBuilder.getHint(FrameBuilder.HINT_COLLECT_ONLY_ENDPOINTS, Boolean.class); return hint == null || hint.equals(FALSE); }
public void markObscured(Object o) { ObscuredValueRegistry registry = builder.getHint(FrameBuilder.HINT_OBSCURED_REGISTRY, ObscuredValueRegistry.class); if (registry == null) { registry = new SimpleObscuredValueRegistry(); builder.setHint(FrameBuilder.HINT_OBSCURED_REGISTRY, registry); } registry.markObscured(o); } }
private Frame exit() { Frame frame=builder.peekFrame(); /* * If about to exit the root frame and current app. name is not set, * make another try to determine it */ if (builder.isCurrentRootFrame(frame)) { ApplicationName name=builder.getHint(FrameBuilder.HINT_APPNAME, ApplicationName.class); if ((name == null) || ApplicationName.UNKOWN_APPLICATION.equals(name)) { ClassLoader cl=ClassUtil.getDefaultClassLoader(getClass()); name = ClassLoaderUtils.findApplicationName(cl); builder.setHint(FrameBuilder.HINT_APPNAME, name); } } return startegy.exit(builder); } }
/** * Update frames counter ({@link AbstractAbortTraceOverflowStrategy#addFrameCount(FrameBuilder)} * {@link AbstractAbortTraceOverflowStrategy#subFrameCount(FrameBuilder)}) * * @param builder frame builder * @param count update value * @return current counter value */ protected static final long updateFrameCount(FrameBuilder builder, long count) { MutableLong counter = builder.getHint(COUNTER_FIELD_HINT, MutableLong.class); if (counter == null) { counter = new MutableLong(0L); builder.setHint(COUNTER_FIELD_HINT, counter); } counter.increment(count); long countToreturn = counter.longValue(); //if the current counter value is negative reset it, but still return the negative value if (countToreturn < 0) { counter.set(0L); } return countToreturn; }
public final void enter(FrameBuilder builder, Operation op) { MutableLong counter = builder.getHint(INTERNAL_COUNTER, MutableLong.class);