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