use of com.newrelic.agent.model.SpanEvent in project newrelic-java-agent by newrelic.
the class DefaultTracerTest method testSpanParentingEvent.
@Test
public void testSpanParentingEvent() {
DefaultTracer tracer = prepareTracer();
tracer.finish(0, null);
SpanProxy spanProxy = tracer.getTransaction().getSpanProxy();
W3CTraceParentHeader.create(spanProxy, "12341234123412341234123412341234", "0101010101010101", false);
SpanEventsService spanEventService = ServiceFactory.getSpanEventService();
((SpanEventsServiceImpl) spanEventService).dispatcherTransactionFinished(new TransactionData(tracer.getTransaction(), 1024), new TransactionStats());
SamplingPriorityQueue<SpanEvent> eventPool = spanEventService.getOrCreateDistributedSamplingReservoir(APP_NAME);
List<SpanEvent> spanEvents = eventPool.asList();
assertNotNull(spanEvents);
assertEquals(1, spanEvents.size());
SpanEvent spanEvent = Iterables.getFirst(spanEvents, null);
assertNotNull(spanEvent);
Assert.assertNotEquals("0101010101010101", spanEvent.getParentId());
}
Aggregations