use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class SpanProcessorV1 method postEventProcess.
@VisibleForTesting
public void postEventProcess(List<SpanEvent> spanEventList, List<TSpanEvent> tSpanEventList, long keyTime) {
if (CollectionUtils.isEmpty(spanEventList)) {
return;
}
if (!(CollectionUtils.nullSafeSize(spanEventList) == CollectionUtils.nullSafeSize(tSpanEventList))) {
throw new IllegalStateException("list size not same, spanEventList=" + CollectionUtils.nullSafeSize(spanEventList) + ", tSpanEventList=" + CollectionUtils.nullSafeSize(tSpanEventList));
}
// check list type
assert spanEventList instanceof RandomAccess;
final int listSize = spanEventList.size();
for (int i = 0; i < listSize; i++) {
final SpanEvent spanEvent = spanEventList.get(i);
final TSpanEvent tSpanEvent = tSpanEventList.get(i);
final long startTime = spanEvent.getStartTime();
final long startElapsedTime = startTime - keyTime;
tSpanEvent.setStartElapsed((int) startElapsedTime);
}
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class SpanProcessorV1 method postProcess.
@Override
public void postProcess(Span span, TSpan tSpan) {
final TraceRoot traceRoot = span.getTraceRoot();
final long keyTime = traceRoot.getTraceStartTime();
List<SpanEvent> spanEventList = span.getSpanEventList();
if (spanEventList == null) {
spanEventList = Collections.emptyList();
}
List<TSpanEvent> tSpanEventList = tSpan.getSpanEventList();
if (tSpanEventList == null) {
tSpanEventList = Collections.emptyList();
}
postEventProcess(spanEventList, tSpanEventList, keyTime);
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class JedisPluginTest method binaryJedis.
@Test
public void binaryJedis() {
JedisMock jedis = new JedisMock("localhost", 6379);
try {
jedis.get("foo".getBytes());
} finally {
close(jedis);
}
final List<SpanEvent> events = getCurrentSpanEvents();
assertEquals(1, events.size());
final SpanEvent eventBo = events.get(0);
assertEquals(HOST + ":" + PORT, eventBo.getEndPoint());
assertEquals("REDIS", eventBo.getDestinationId());
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class OrderedSpanRecorder method handleSpanEvent.
private void handleSpanEvent(SpanChunk spanChunk) {
List<SpanEvent> spanEventList = spanChunk.getSpanEventList();
if (spanEventList.size() != 1) {
throw new IllegalStateException("spanEvent.size != 1");
}
final SpanEvent event = spanEventList.get(0);
long startTime = event.getStartTime();
Item<SpanType> item = new Item<SpanType>(spanChunk, startTime, spanChunk.getTraceRoot(), event.getSequence());
insertItem(item);
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class ApplicationContextHandler method addApiDescription.
private void addApiDescription(List<String> list, List<SpanEvent> spanEventList) {
for (SpanEvent spanEvent : spanEventList) {
int apiId = spanEvent.getApiId();
String apiDescription = this.tcpDataSender.getApiDescription(apiId);
list.add(apiDescription);
}
}
Aggregations