use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class SpanStreamUDPSenderTest method createSpanEventList.
private List<SpanEvent> createSpanEventList(int size) throws InterruptedException {
// Span span = new SpanBo(new TSpan());
Span span = new Span();
List<SpanEvent> spanEventList = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
SpanEvent spanEvent = new SpanEvent(span);
spanEvent.markStartTime();
Thread.sleep(1);
spanEvent.markAfterTime();
spanEventList.add(spanEvent);
}
return spanEventList;
}
use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class OrderedSpanRecorder method handleSpanEvent.
private void handleSpanEvent(SpanEvent event) {
Span span = event.getSpan();
int asyncId = event.isSetAsyncId() ? event.getAsyncId() : ASYNC_ID_NOT_SET;
insertItem(new Item(event, span.getStartTime() + event.getStartElapsed(), span.getSpanId(), event.getSequence(), asyncId));
}
use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class PluginTestAgent method verifyIsLoggingTransactionInfo.
@Override
public void verifyIsLoggingTransactionInfo(LoggingInfo loggingInfo) {
Object actual = popSpan();
Span span = null;
if (actual instanceof Span) {
span = (Span) actual;
} else if (actual instanceof SpanEvent) {
span = ((SpanEvent) actual).getSpan();
} else {
throw new IllegalArgumentException("Unexpected type: " + getActual(actual));
}
if (span.getLoggingTransactionInfo() != loggingInfo.getCode()) {
LoggingInfo loggingTransactionInfo = LoggingInfo.searchByCode(span.getLoggingTransactionInfo());
if (loggingTransactionInfo != null) {
throw new AssertionError("Expected a Span isLoggingTransactionInfo value with [" + loggingInfo.getName() + "] but was [" + loggingTransactionInfo.getName() + "]. expected: " + loggingInfo.getName() + ", was: " + loggingTransactionInfo.getName());
} else {
throw new AssertionError("Expected a Span isLoggingTransactionInfo value with [" + loggingInfo.getName() + "] but loggingTransactionInfo value invalid.");
}
}
}
use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class OrderedSpanRecorderTest method createSpan.
private Span createSpan(long startTime, long spanId) {
Span span = new Span();
span.setStartTime(startTime);
span.setSpanId(spanId);
return span;
}
use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class SpanStreamSendDataSerializerTest method createSpan.
private Span createSpan(List<SpanEvent> spanEventList) {
DefaultTraceId traceId = new DefaultTraceId("test", 0, 1);
Span span = new Span();
for (SpanEvent spanEvent : spanEventList) {
span.addToSpanEventList(spanEvent);
}
span.setAgentId("agentId");
span.recordTraceId(traceId);
return span;
}
Aggregations