use of zipkin.Span in project zipkin by openzipkin.
the class CorrectForClockSkewTest method getClockSkew_requiresCoreAnnotationsToHaveEndpoints.
@Test
public void getClockSkew_requiresCoreAnnotationsToHaveEndpoints() {
Span span = Span.builder().traceId(1L).parentId(2L).id(3L).name("").addAnnotation(Annotation.create(20, CLIENT_SEND, null)).addAnnotation(Annotation.create(10, /* skew */
SERVER_RECV, null)).addAnnotation(Annotation.create(20, SERVER_SEND, null)).addAnnotation(Annotation.create(40, CLIENT_RECV, null)).build();
assertThat(getClockSkew(span)).isNull();
}
use of zipkin.Span in project zipkin by openzipkin.
the class CorrectForClockSkewTest method spanWithLCAnnotationIsLocalSpan.
@Test
public void spanWithLCAnnotationIsLocalSpan() {
Span localSpan = localSpan(TestObjects.TRACE.get(0), WEB_ENDPOINT, 0, 0);
assertTrue(isLocalSpan(localSpan));
}
use of zipkin.Span in project zipkin by openzipkin.
the class CorrectForClockSkewTest method getClockSkew_endpointIsServer.
@Test
public void getClockSkew_endpointIsServer() {
Span span = Span.builder().traceId(1L).parentId(2L).id(3L).name("").addAnnotation(Annotation.create(20, CLIENT_SEND, WEB_ENDPOINT)).addAnnotation(Annotation.create(10, /* skew */
SERVER_RECV, APP_ENDPOINT)).addAnnotation(Annotation.create(20, SERVER_SEND, APP_ENDPOINT)).addAnnotation(Annotation.create(40, CLIENT_RECV, WEB_ENDPOINT)).build();
assertThat(getClockSkew(span).endpoint).isEqualTo(APP_ENDPOINT);
}
use of zipkin.Span in project zipkin by openzipkin.
the class GroupByTraceIdTest method sortsDescending.
@Test
public void sortsDescending() {
Span span1 = LOTS_OF_SPANS[0].toBuilder().timestamp(1L).build();
Span span2 = LOTS_OF_SPANS[1].toBuilder().timestamp(2L).build();
assertThat(GroupByTraceId.apply(asList(span1, span2), false, false)).containsExactly(asList(span2), asList(span1));
}
use of zipkin.Span in project zipkin by openzipkin.
the class SpanStoreTest method getTraces_128.
@Test
public void getTraces_128() {
Span span1 = TestObjects.TRACE.get(0).toBuilder().traceIdHigh(1L).binaryAnnotations(asList(BinaryAnnotation.create("key", "value1", WEB_ENDPOINT))).build();
Span span2 = span1.toBuilder().traceIdHigh(2L).binaryAnnotations(asList(BinaryAnnotation.create("key", "value2", WEB_ENDPOINT))).build();
accept(span1, span2);
assertThat(store().getTraces(QueryRequest.builder().serviceName(WEB_ENDPOINT.serviceName).addBinaryAnnotation("key", "value2").build())).containsExactly(asList(span2));
}
Aggregations