[유치수] [NOBTS] thrift

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@572 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Chisu Yu
2012-09-04 08:37:38 +00:00
parent 98a3f71464
commit a57e2ab393
13 changed files with 565 additions and 634 deletions
@@ -91,4 +91,31 @@ public class Span {
return sb.toString();
}
public com.profiler.context.gen.Span toThrift() {
com.profiler.context.gen.Span span = new com.profiler.context.gen.Span();
span.setTimestamp(createTime);
span.setMostTraceID(traceID.getTraceId().getMostSignificantBits());
span.setLeastTraceID(traceID.getTraceId().getLeastSignificantBits());
span.setName(name);
span.setSpanID(traceID.getSpanId());
span.setParentSpanId(traceID.getParentSpanId());
List<com.profiler.context.gen.Annotation> annotationList = new ArrayList<com.profiler.context.gen.Annotation>(annotations.size());
for (HippoAnnotation a : annotations) {
annotationList.add(a.toThrift());
}
span.setAnnotations(annotationList);
List<com.profiler.context.gen.BinaryAnnotation> binaryAnnotationList = new ArrayList<com.profiler.context.gen.BinaryAnnotation>(binaryAnnotations.size());
for (HippoBinaryAnnotation a : binaryAnnotations) {
binaryAnnotationList.add(a.toThrift());
}
span.setBinaryAnnotations(binaryAnnotationList);
span.setFlag(traceID.getFlags());
return span;
}
}