/** * Add annotations from the htrace Span. */ private List<Annotation> createZipkinAnnotations(org.apache.htrace.core.Span hTraceSpan, Endpoint ep) { List<Annotation> annotationList = new ArrayList<Annotation>(); // add first zipkin annotation. annotationList.add(createZipkinAnnotation(zipkinCoreConstants.CLIENT_SEND, hTraceSpan.getStartTimeMillis(), ep, true)); annotationList.add(createZipkinAnnotation(zipkinCoreConstants.SERVER_RECV, hTraceSpan.getStartTimeMillis(), ep, true)); // add HTrace time annotation for (TimelineAnnotation ta : hTraceSpan.getTimelineAnnotations()) { annotationList.add(createZipkinAnnotation(ta.getMessage(), ta.getTime(), ep, true)); } // add last zipkin annotation annotationList.add(createZipkinAnnotation(zipkinCoreConstants.SERVER_SEND, hTraceSpan.getStopTimeMillis(), ep, false)); annotationList.add(createZipkinAnnotation(zipkinCoreConstants.CLIENT_RECV, hTraceSpan.getStopTimeMillis(), ep, false)); return annotationList; }
/** * Add annotations from the htrace Span. */ private List<Annotation> createZipkinAnnotations(org.apache.htrace.core.Span hTraceSpan, Endpoint ep) { List<Annotation> annotationList = new ArrayList<Annotation>(); // add first zipkin annotation. annotationList.add(createZipkinAnnotation(zipkinCoreConstants.CLIENT_SEND, hTraceSpan.getStartTimeMillis(), ep, true)); annotationList.add(createZipkinAnnotation(zipkinCoreConstants.SERVER_RECV, hTraceSpan.getStartTimeMillis(), ep, true)); // add HTrace time annotation for (TimelineAnnotation ta : hTraceSpan.getTimelineAnnotations()) { annotationList.add(createZipkinAnnotation(ta.getMessage(), ta.getTime(), ep, true)); } // add last zipkin annotation annotationList.add(createZipkinAnnotation(zipkinCoreConstants.SERVER_SEND, hTraceSpan.getStopTimeMillis(), ep, false)); annotationList.add(createZipkinAnnotation(zipkinCoreConstants.CLIENT_RECV, hTraceSpan.getStopTimeMillis(), ep, false)); return annotationList; }
Tracer.getCurrentSpan().getTimelineAnnotations().isEmpty()); assertEquals("Duplicated child span descriptions.", TASK_COUNT, results.size());
span.getTimelineAnnotations(); if (!timelineAnnotations.isEmpty()) { jgen.writeArrayFieldStart("t");
span.getTimelineAnnotations(); if (!timelineAnnotations.isEmpty()) { jgen.writeArrayFieldStart("t");
span.getTimelineAnnotations(); if (!timelineAnnotations.isEmpty()) { jgen.writeArrayFieldStart("t");
for (TimelineAnnotation ta : span.getTimelineAnnotations()) { sbuilder.addTimeline(tlbuilder.clear() .setTime(ta.getTime())
public static void appendJsonString(Span span, OutputStreamWriter writer) throws IOException { writer.append("{"); appendField(JSON_FIELD_TRACE_ID, span.getSpanId().getLow(), writer); appendField(JSON_FIELD_SPAN_ID, span.getSpanId().getHigh(), writer); appendField(JSON_FIELD_DESCRIPTION, span.getDescription(), writer); if (span.getParents().length != 0) { appendField(JSON_FIELD_PARENT_ID, span.getParents()[0].getLow(), writer); } appendField(JSON_FIELD_START, span.getStartTimeMillis(), writer); appendField(JSON_FIELD_STOP, span.getStopTimeMillis(), writer); if (!span.getTimelineAnnotations().isEmpty()) { writer.append("\""); writer.append(JSON_FIELD_TIMELINE); writer.append("\""); writer.append(":"); writer.append("["); for (TimelineAnnotation annotation : span.getTimelineAnnotations()) { writer.append("{"); appendField(JSON_FIELD_TIMELINE_TIME, annotation.getTime(), writer); appendField(JSON_FIELD_TIMELINE_MESSEGE, annotation.getMessage(), writer); writer.append("}"); } writer.append("]"); } writer.append("}"); }
expected.getTimelineAnnotations(); List<TimelineAnnotation> gotTimeline = got.getTimelineAnnotations(); if (expectedTimeline == null) { assertEquals(null, gotTimeline);
session.apply(spanInsert); long annotationCounter = 0; for (TimelineAnnotation ta : span.getTimelineAnnotations()) { annotationCounter++; Insert timelineInsert = tableTimeline.newInsert();