ClientSpan createClientSpan(Span parent) { ClientSpan span = new ClientSpan(); 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; }
ClientSpan clientSpan = new ClientSpan(); clientSpan.setSpanIdent(spanIdent); invocationSequenceHook.addDefaultData(clientSpan); invocationSequenceHook.firstAfterBody(methodId, sensorTypeId, object, parameters, result, false, rsc);
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; } }
((ClientSpan) span03).setDuration(50); ((ServerSpan) span04).setDuration(40); ((ServerSpan) span05).setDuration(30); ((ClientSpan) span03).setReferenceType(References.FOLLOWS_FROM);
assertThat(captor.getValue().getPlatformIdent(), is(platformId)); assertThat(captor.getValue().getSensorTypeIdent(), is(sensorId)); assertThat(captor.getValue().getMethodIdent(), is(methodId));
invocationSequenceHook.beforeBody(methodId2, sensorTypeId, object, parameters, rsc); AbstractSpan span = new ClientSpan(); span.setSpanIdent(new SpanIdent(1, 2)); invocationSequenceHook.addDefaultData(span);
assertThat(captor.getValue().getPlatformIdent(), is(platformId)); assertThat(captor.getValue().getSensorTypeIdent(), is(sensorId)); assertThat(captor.getValue().getMethodIdent(), is(methodId));