use of com.navercorp.pinpoint.web.filter.visitor.SpanEventVisitor 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.web.filter.visitor.SpanEventVisitor 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.web.filter.visitor.SpanEventVisitor in project pinpoint by naver.
the class WasToUnknownFilter method include.
public boolean include(LinkContext spanContainer) {
/*
* WAS -> UNKNOWN
*/
final List<SpanBo> fromNode = spanContainer.findFromNode();
if (!rpcUrlFilter.accept(fromNode)) {
return false;
}
SpanAcceptor acceptor = new SpanReader(fromNode);
return acceptor.accept(new SpanEventVisitor() {
@Override
public boolean visit(SpanEventBo spanEventBo) {
return filter(spanEventBo, spanContainer);
}
});
}
use of com.navercorp.pinpoint.web.filter.visitor.SpanEventVisitor in project pinpoint by naver.
the class WasToBackendFilter method include.
public boolean include(LinkContext linkContext) {
final List<SpanBo> fromNode = linkContext.findFromNode();
SpanAcceptor acceptor = new SpanReader(fromNode);
return acceptor.accept(new SpanEventVisitor() {
@Override
public boolean visit(SpanEventBo spanEventBo) {
return filter(spanEventBo, linkContext);
}
});
}
Aggregations