[유치수] [NOBTS] create class associated with Tagging.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@526 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Chisu Yu
2012-08-22 02:26:05 +00:00
parent d67644370a
commit ddd2c772c4
24 changed files with 12014 additions and 5784 deletions
@@ -0,0 +1,38 @@
package com.profiler.context;
import com.profiler.context.gen.Annotation;
import com.profiler.context.gen.BinaryAnnotation;
import com.profiler.context.gen.Span;
/**
*
* @author netspider
*
*/
public class Trace {
private static final int NO_PARENT_SPAN_ID = -1;
private final String traceID;
private final Span span;
Trace(String traceID, String parentSpanID, String name, boolean debug) {
this.traceID = (traceID == null) ? TraceID.newTraceID() : traceID;
this.span = new Span();
this.span.setTraceID(this.traceID);
this.span.setSpanID(SpanID.newSpanID());
this.span.setParentSpanId(parentSpanID);
this.span.setName(name);
this.span.setDebug(debug);
}
public void record(Annotation annotation) {
span.addToAnnotations(annotation);
}
public void recordBinary(BinaryAnnotation annotation) {
span.addToBinaryAnnotations(annotation);
}
}