/** * @param traceName * @param attrName * @param tag * @param value */ public void newTraceAttr(String traceName, String attrName, String tag, Object value) { tracer .getHandler() .newAttr( symbolRegistry.symbolId(traceName), symbolRegistry.symbolId(attrName), new TaggedValue(symbolRegistry.symbolId(tag), value)); }
public String listIncludes() { StringBuilder sb = new StringBuilder(); for (SpyMatcher sm : tracer.getMatcherSet().getMatchers()) { sb.append(sm.hasFlags(SpyMatcher.EXCLUDE_MATCH) ? "excl: " : "incl: "); sb.append(sm); sb.append("\n"); } return sb.toString(); }
public void clearOutputs() { tracer.clearOutputs(); }
/** * Configures tracer output. * * @param output trace processing object */ public void output(ZorkaAsyncThread<SymbolicRecord> output) { tracer.addOutput(output); }
public boolean isTraceSpyMethods() { return tracer.isTraceSpyMethods(); }
public void setTraceSpyMethods(boolean tsm) { tracer.setTraceSpyMethods(tsm); }
public int getTracerMaxTraceRecords() { return Tracer.getMaxTraceRecords(); }
public void setTracerMaxTraceRecords(long maxRecords) { Tracer.setMaxTraceRecords((int) maxRecords); }
public void traceBegin(String name, long minimumTraceTime, int flags) { TraceBuilder traceBuilder = tracer.getHandler(); traceBuilder.traceBegin(symbolRegistry.symbolId(name), System.currentTimeMillis(), flags); traceBuilder.setMinimumTraceTime(minimumTraceTime); }
/** * Sets minimum traced method execution time. Methods that took less time will be discarded from * traces and will only reflect in summary call/error counters. * * @param methodTime minimum execution time (in nanoseconds, 250 microseconds by default) */ public void setTracerMinMethodTime(long methodTime) { Tracer.setMinMethodTime(methodTime); }
public long getTracerMinMethodTime() { return Tracer.getMinMethodTime(); }
public void filterTrace(boolean decision) { tracer .getHandler() .markTraceFlags(0, decision ? TraceMarker.SUBMIT_TRACE : TraceMarker.DROP_TRACE); }
public void newFlags(int flags) { tracer.getHandler().markTraceFlags(0, flags); }
/** * Adds trace attribute to trace record immediately. This is useful for programmatic attribute * setting. * * @param attrName attribute name * @param value attribute value */ public void newAttr(String attrName, Object value) { tracer.getHandler().newAttr(-1, symbolRegistry.symbolId(attrName), value); }
public boolean isInTrace(String traceName) { return tracer.getHandler().isInTrace(symbolRegistry.symbolId(traceName)); }
/** * Adds matching method to tracer. * * @param matchers spy matcher objects (created using spy.byXxxx() functions) */ public void include(String... matchers) { for (String matcher : matchers) { log.info(ZorkaLogger.ZAG_CONFIG, "Tracer include: " + matcher); tracer.include(SpyMatcher.fromString(matcher.toString())); } }
public void include(SpyMatcher... matchers) { for (SpyMatcher matcher : matchers) { log.info(ZorkaLogger.ZAG_CONFIG, "Tracer include: " + matcher); tracer.include(matcher); } }
/** * Sets maximum number of records that will be stored in a single trace. This setting prevents * agent from overrunning memory when instrumented code has very long (and complex) execution * path. After maximum number is reached, all remaining records will be discarded but numbers of * calls and errors of discarded methods will be reflected in summary data. * * @param maxRecords maximum numbner of trace records */ public void setTracerMaxTraceRecords(int maxRecords) { Tracer.setMaxTraceRecords(maxRecords); }