use of com.navercorp.pinpoint.profiler.context.storage.SpanStorage in project pinpoint by naver.
the class TraceTest method trace.
@Test
public void trace() {
TraceId traceId = new DefaultTraceId("agent", 0, 1);
CallStackFactory callStackFactory = new DefaultCallStackFactory(64);
SpanFactory spanFactory = new DefaultSpanFactory("appName", "agentId", 0, ServiceType.STAND_ALONE);
StringMetaDataService stringMetaDataService = mock(StringMetaDataService.class);
SqlMetaDataService sqlMetaDataService = mock(SqlMetaDataService.class);
RecorderFactory recorderFactory = new DefaultRecorderFactory(stringMetaDataService, sqlMetaDataService);
AsyncIdGenerator asyncIdGenerator = mock(AsyncIdGenerator.class);
SpanStorage storage = new SpanStorage(LoggingDataSender.DEFAULT_LOGGING_DATA_SENDER);
Trace trace = new DefaultTrace(callStackFactory, storage, traceId, 0L, asyncIdGenerator, true, spanFactory, recorderFactory);
trace.traceBlockBegin();
// get data form db
getDataFromDB(trace);
// response to client
trace.traceBlockEnd();
}
use of com.navercorp.pinpoint.profiler.context.storage.SpanStorage in project pinpoint by naver.
the class TraceTest method popEventTest.
@Test
public void popEventTest() {
TraceId traceId = new DefaultTraceId("agent", 0, 1);
CallStackFactory callStackFactory = new DefaultCallStackFactory(64);
SpanFactory spanFactory = new DefaultSpanFactory("appName", "agentId", 0, ServiceType.STAND_ALONE);
StringMetaDataService stringMetaDataService = mock(StringMetaDataService.class);
SqlMetaDataService sqlMetaDataService = mock(SqlMetaDataService.class);
RecorderFactory recorderFactory = new DefaultRecorderFactory(stringMetaDataService, sqlMetaDataService);
AsyncIdGenerator asyncIdGenerator = mock(AsyncIdGenerator.class);
TestDataSender dataSender = new TestDataSender();
SpanStorage storage = new SpanStorage(LoggingDataSender.DEFAULT_LOGGING_DATA_SENDER);
Trace trace = new DefaultTrace(callStackFactory, storage, traceId, 0L, asyncIdGenerator, true, spanFactory, recorderFactory);
trace.close();
logger.debug(String.valueOf(dataSender.event));
}
use of com.navercorp.pinpoint.profiler.context.storage.SpanStorage in project pinpoint by naver.
the class DefaultTraceTest method testPushPop.
@Test
public void testPushPop() {
CallStackFactory callStackFactory = new DefaultCallStackFactory(64);
SpanFactory spanFactory = new DefaultSpanFactory("appName", "agentId", 0, ServiceType.STAND_ALONE);
StringMetaDataService stringMetaDataService = mock(StringMetaDataService.class);
SqlMetaDataService sqlMetaDataService = mock(SqlMetaDataService.class);
RecorderFactory recorderFactory = new DefaultRecorderFactory(stringMetaDataService, sqlMetaDataService);
AsyncIdGenerator asyncIdGenerator = mock(AsyncIdGenerator.class);
SpanStorage storage = new SpanStorage(LoggingDataSender.DEFAULT_LOGGING_DATA_SENDER);
long localTransactionId = 1;
TraceId traceId = new DefaultTraceId("agentId", System.currentTimeMillis(), localTransactionId);
Trace trace = new DefaultTrace(callStackFactory, storage, traceId, localTransactionId, asyncIdGenerator, true, spanFactory, recorderFactory);
trace.traceBlockBegin();
trace.traceBlockBegin();
trace.traceBlockEnd();
trace.traceBlockEnd();
trace.close();
}
Aggregations