use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class SpanEventBitFieldTest method testStartElapsed_equals_next.
@Test
public void testStartElapsed_equals_next() throws Exception {
SpanEventBo prev = new SpanEventBo();
SpanEventBo current = new SpanEventBo();
prev.setStartElapsed(1234);
current.setStartElapsed(1234);
SpanEventBitField bitField = SpanEventBitField.build(current, prev);
Assert.assertEquals(bitField.getStartElapsedEncodingStrategy(), StartElapsedTimeEncodingStrategy.PREV_EQUALS);
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class FilteredMapBuilder method getParentsSpan.
private SpanBo getParentsSpan(SpanBo currentSpan, MultiValueMap<Long, SpanBo> transactionSpanMap) {
List<SpanBo> parentSpanCandidateList = transactionSpanMap.get(currentSpan.getParentSpanId());
if (parentSpanCandidateList == null) {
return null;
}
if (CollectionUtils.nullSafeSize(parentSpanCandidateList) == 1) {
return parentSpanCandidateList.get(0);
} else {
for (SpanBo parentSpanCandidate : parentSpanCandidateList) {
SpanAcceptor acceptor = new SpanReader(Collections.singletonList(parentSpanCandidate));
boolean accept = acceptor.accept(new SpanEventVisitAdaptor(new SpanEventVisitor() {
@Override
public boolean visit(SpanEventBo spanEventBo) {
if (spanEventBo.getNextSpanId() == currentSpan.getSpanId()) {
return SpanVisitor.ACCEPT;
}
return SpanVisitor.REJECT;
}
}));
if (accept) {
return parentSpanCandidate;
}
}
logger.warn("Can not find suitable ParentSpan.(CurrentSpan:{})", currentSpan);
return parentSpanCandidateList.get(0);
}
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class FilteredMapBuilder method addNodeFromSpanEvent.
private void addNodeFromSpanEvent(SpanBo span, Application srcApplication, MultiValueMap<Long, SpanBo> transactionSpanMap) {
/*
* add span event statistics
*/
LinkDataMap sourceLinkDataMap = linkDataDuplexMap.getSourceLinkDataMap();
SpanAcceptor acceptor = new SpanReader(Collections.singletonList(span));
acceptor.accept(new SpanEventVisitAdaptor(new SpanEventVisitor() {
@Override
public boolean visit(SpanEventBo spanEventBo) {
addNode(span, transactionSpanMap, srcApplication, sourceLinkDataMap, spanEventBo);
return SpanVisitor.REJECT;
}
}));
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class SpanEncoderV0 method encodeSpanChunkQualifier.
@Override
public ByteBuffer encodeSpanChunkQualifier(SpanEncodingContext<SpanChunkBo> encodingContext) {
final SpanChunkBo spanChunkBo = encodingContext.getValue();
final List<SpanEventBo> spanEventBoList = spanChunkBo.getSpanEventBoList();
final SpanEventBo firstEvent = getFirstSpanEvent(spanEventBoList);
LocalAsyncIdBo localAsyncId = spanChunkBo.getLocalAsyncId();
return encodeQualifier(TYPE_SPAN_CHUNK, spanChunkBo, firstEvent, localAsyncId);
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class SpanEncoderV0 method encodeSpanChunkColumnValue.
@Override
public ByteBuffer encodeSpanChunkColumnValue(SpanEncodingContext<SpanChunkBo> encodingContext) {
final SpanChunkBo spanChunkBo = encodingContext.getValue();
final Buffer buffer = new AutomaticBuffer(256);
final byte version = (byte) spanChunkBo.getVersion();
buffer.putByte(version);
if (version == SpanVersion.TRACE_V2) {
long keyTime = spanChunkBo.getKeyTime();
buffer.putVLong(keyTime);
}
final List<SpanEventBo> spanEventBoList = spanChunkBo.getSpanEventBoList();
writeSpanEventList(buffer, spanEventBoList, encodingContext);
return buffer.wrapByteBuffer();
}
Aggregations