示例#1
0
 /**
  * @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));
 }
示例#2
0
 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();
 }
示例#3
0
 public void clearOutputs() {
   tracer.clearOutputs();
 }
示例#4
0
 /**
  * Configures tracer output.
  *
  * @param output trace processing object
  */
 public void output(ZorkaAsyncThread<SymbolicRecord> output) {
   tracer.addOutput(output);
 }
示例#5
0
 public boolean isTraceSpyMethods() {
   return tracer.isTraceSpyMethods();
 }
示例#6
0
 public void setTraceSpyMethods(boolean tsm) {
   tracer.setTraceSpyMethods(tsm);
 }
示例#7
0
 public int getTracerMaxTraceRecords() {
   return Tracer.getMaxTraceRecords();
 }
示例#8
0
 public void setTracerMaxTraceRecords(long maxRecords) {
   Tracer.setMaxTraceRecords((int) maxRecords);
 }
示例#9
0
 public void traceBegin(String name, long minimumTraceTime, int flags) {
   TraceBuilder traceBuilder = tracer.getHandler();
   traceBuilder.traceBegin(symbolRegistry.symbolId(name), System.currentTimeMillis(), flags);
   traceBuilder.setMinimumTraceTime(minimumTraceTime);
 }
示例#10
0
 /**
  * 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);
 }
示例#11
0
 public long getTracerMinMethodTime() {
   return Tracer.getMinMethodTime();
 }
示例#12
0
 public void filterTrace(boolean decision) {
   tracer
       .getHandler()
       .markTraceFlags(0, decision ? TraceMarker.SUBMIT_TRACE : TraceMarker.DROP_TRACE);
 }
示例#13
0
 public void newFlags(int flags) {
   tracer.getHandler().markTraceFlags(0, flags);
 }
示例#14
0
 /**
  * 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);
 }
示例#15
0
 public boolean isInTrace(String traceName) {
   return tracer.getHandler().isInTrace(symbolRegistry.symbolId(traceName));
 }
示例#16
0
 /**
  * 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()));
   }
 }
示例#17
0
 public void include(SpyMatcher... matchers) {
   for (SpyMatcher matcher : matchers) {
     log.info(ZorkaLogger.ZAG_CONFIG, "Tracer include: " + matcher);
     tracer.include(matcher);
   }
 }
示例#18
0
 /**
  * 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);
 }