use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class DefaultSpanRecorderTest method testRecordApiId.
@Test
public void testRecordApiId() throws Exception {
Span span = new Span(traceRoot);
SpanRecorder recorder = new DefaultSpanRecorder(span, true, true, stringMetaDataService, sqlMetaDataService, errorHandler);
final int API_ID = 1000;
recorder.recordApiId(API_ID);
Assert.assertEquals("API ID", span.getApiId(), API_ID);
}
use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class DefaultSpanRecorderTest method testRecordEndPoint.
@Test
public void testRecordEndPoint() throws Exception {
when(traceRoot.getShared()).thenReturn(shared);
Span span = new Span(traceRoot);
SpanRecorder recorder = new DefaultSpanRecorder(span, true, true, stringMetaDataService, sqlMetaDataService, errorHandler);
final String endPoint = "endPoint";
recorder.recordEndPoint(endPoint);
verify(traceRoot.getShared()).setEndPoint(endPoint);
}
use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class BufferedStorageTest method testStore_spanFlush.
@Test
public void testStore_spanFlush() throws Exception {
BufferedStorage bufferedStorage = newBufferedStorage(10);
Span span = new Span(internalTraceId);
bufferedStorage.store(span);
bufferedStorage.store(span);
bufferedStorage.store(span);
Assert.assertEquals(3, countingDataSender.getSenderCounter());
Assert.assertEquals(3, countingDataSender.getTotalCount());
Assert.assertEquals(3, countingDataSender.getSpanCounter());
Assert.assertEquals(0, countingDataSender.getSpanChunkCounter());
}
use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class BufferedStorageTest method testStore_manual_flush.
@Test
public void testStore_manual_flush() throws Exception {
BufferedStorage bufferedStorage = newBufferedStorage(10);
Span span = new Span(internalTraceId);
SpanEvent spanEvent = new SpanEvent();
bufferedStorage.store(spanEvent);
bufferedStorage.store(spanEvent);
bufferedStorage.flush();
Assert.assertEquals(1, countingDataSender.getSenderCounter());
Assert.assertEquals(1, countingDataSender.getTotalCount());
Assert.assertEquals(0, countingDataSender.getSpanCounter());
Assert.assertEquals(1, countingDataSender.getSpanChunkCounter());
}
use of com.navercorp.pinpoint.profiler.context.Span in project pinpoint by naver.
the class BufferedStorageTest method testStore_Noflush.
@Test
public void testStore_Noflush() throws Exception {
BufferedStorage bufferedStorage = newBufferedStorage(10);
Span span = new Span(internalTraceId);
SpanEvent spanEvent = new SpanEvent();
bufferedStorage.store(spanEvent);
bufferedStorage.store(spanEvent);
Assert.assertEquals(0, countingDataSender.getTotalCount());
}
Aggregations