mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-17 16:56:15 +10:00
[유치수] [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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user