ServerSpan createServerSpan(Span parent) { ServerSpan span = new ServerSpan(); span.setSpanIdent(new SpanIdent(idSequence++, 0)); span.setTimeStamp(new Timestamp(timeSequence++)); span.setPropagationType(PropagationType.PROCESS); if (parent != null) { span.setParentSpanId(parent.getSpanIdent().getId()); } return span; }
assertThat(captor.getValue().getPlatformIdent(), is(platformId)); assertThat(captor.getValue().getSensorTypeIdent(), is(sensorId)); assertThat(captor.getValue().getMethodIdent(), is(methodId));
/** * Creates {@link ClientSpan} or {@link ServerSpan} based on the information from the given * {@link SpanImpl}. * * @param spanImpl * opentracing span impl * @return {@link AbstractSpan} */ private static AbstractSpan createCorrectSpanType(SpanImpl spanImpl) { if (spanImpl.isClient()) { ClientSpan clientSpan = new ClientSpan(); return clientSpan; } else { ServerSpan serverSpan = new ServerSpan(); return serverSpan; } }
ServerSpan createSdkSpan(Span parent) { ServerSpan span = createServerSpan(parent); span.setPropagationType(null); return span; }
_invoc04.setParentSequence(invoc03); ((ServerSpan) span01).setDuration(260); ((ServerSpan) span02).setDuration(100); ((ClientSpan) span03).setDuration(50); ((ServerSpan) span04).setDuration(40); ((ServerSpan) span05).setDuration(30);
assertThat(captor.getValue().getPlatformIdent(), is(platformId)); assertThat(captor.getValue().getSensorTypeIdent(), is(sensorId)); assertThat(captor.getValue().getMethodIdent(), is(methodId));