use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class BufferedStorageTest method testStore_flush.
@Test
public void testStore_flush() throws Exception {
BufferedStorage bufferedStorage = newBufferedStorage(1);
Span span = new Span(internalTraceId);
SpanEvent spanEvent = new SpanEvent();
bufferedStorage.store(spanEvent);
bufferedStorage.store(spanEvent);
Assert.assertEquals(2, countingDataSender.getSenderCounter());
Assert.assertEquals(2, countingDataSender.getTotalCount());
Assert.assertEquals(2, countingDataSender.getSpanChunkCounter());
Assert.assertEquals(0, countingDataSender.getSpanCounter());
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class BufferedStorageTest method testStore_spanLastFlush.
@Test
public void testStore_spanLastFlush() throws Exception {
BufferedStorage bufferedStorage = newBufferedStorage(10);
Span span = new Span(internalTraceId);
SpanEvent spanEvent = new SpanEvent();
bufferedStorage.store(spanEvent);
bufferedStorage.store(spanEvent);
bufferedStorage.store(span);
Assert.assertEquals(1, countingDataSender.getSenderCounter());
Assert.assertEquals(1, countingDataSender.getTotalCount());
Assert.assertEquals(1, countingDataSender.getSpanCounter());
Assert.assertEquals(0, countingDataSender.getSpanChunkCounter());
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class WrappedSpanEventRecorderTest method testRecordAPIId.
@Test
public void testRecordAPIId() throws Exception {
SpanEvent spanEvent = new SpanEvent();
WrappedSpanEventRecorder recorder = new WrappedSpanEventRecorder(traceRoot, asyncContextFactory, stringMetaDataService, sqlMetaDataService, errorHandler);
recorder.setWrapped(spanEvent);
final int API_ID = 1000;
recorder.recordApiId(API_ID);
Assert.assertEquals("API ID", spanEvent.getApiId(), API_ID);
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class MSSSqlConnectionIT method testModify.
@Test
public void testModify() throws Exception {
logger.debug("testModify");
Connection connection = connectDB();
logger.debug("Connection class name:{}", connection.getClass().getName());
logger.debug("Connection class cl:{}", connection.getClass().getClassLoader());
DatabaseInfo url = ((DatabaseInfoAccessor) connection)._$PINPOINT$_getDatabaseInfo();
Assert.assertNotNull(url);
List<SpanEvent> currentSpanEvents = getCurrentSpanEvents();
logger.debug("{}", currentSpanEvents);
// Assert.assertEquals(1, currentSpanEvents.size());
statement(connection);
currentSpanEvents = getCurrentSpanEvents();
logger.debug("{}", currentSpanEvents);
// Assert.assertEquals(2, currentSpanEvents.size());
preparedStatement(connection);
preparedStatement2(connection);
preparedStatement3(connection);
preparedStatement4(connection);
preparedStatement5(connection);
preparedStatement6(connection);
preparedStatement7(connection);
preparedStatement8(connection);
connection.close();
DatabaseInfo clearUrl = ((DatabaseInfoAccessor) connection)._$PINPOINT$_getDatabaseInfo();
Assert.assertNull(clearUrl);
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class SpanEventBuilder method addSpanEvent.
public void addSpanEvent() {
SpanEvent spanEvent = new SpanEvent();
spanEvent.setSequence(nextSequence());
spanEvent.setStartTime(nextStartTime());
spanEventList.add(spanEvent);
}
Aggregations