use of com.navercorp.pinpoint.common.server.bo.SpanEventBo 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);
}
});
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class RpcURLPatternFilter method accept.
@Override
public boolean accept(List<SpanBo> fromSpanList) {
for (SpanBo spanBo : fromSpanList) {
final List<SpanEventBo> spanEventBoList = spanBo.getSpanEventBoList();
if (CollectionUtils.isEmpty(spanEventBoList)) {
return REJECT;
}
for (SpanEventBo event : spanEventBoList) {
final ServiceType eventServiceType = serviceTypeRegistryService.findServiceType(event.getServiceType());
if (!eventServiceType.isRpcClient()) {
continue;
}
if (!eventServiceType.isRecordStatistics()) {
continue;
}
// http://api.domain.com/test/ArticleList.do
// slice url ->/test/ArticleList.do
final List<AnnotationBo> annotationBoList = event.getAnnotationBoList();
if (annotationBoList == null) {
continue;
}
for (AnnotationBo annotationBo : annotationBoList) {
// TODO ?? url format & annotation type detect
int key = annotationBo.getKey();
if (isURL(key)) {
String url = (String) annotationBo.getValue();
String path = getPath(url);
final boolean match = matcher.match(urlPattern, path);
if (match) {
return ACCEPT;
}
}
}
}
}
return REJECT;
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class Node method buildAlignList.
private List<Align> buildAlignList(List<SpanEventBo> spanEventBoList) {
if (CollectionUtils.isEmpty(spanEventBoList)) {
return Collections.emptyList();
}
List<Align> alignList = new ArrayList<>();
for (SpanEventBo spanEventBo : spanEventBoList) {
if (logger.isDebugEnabled()) {
logger.debug("Populate spanEvent{seq={}, depth={}, event={}}", spanEventBo.getSequence(), spanEventBo.getDepth(), spanEventBo);
}
final Align spanEventAlign = this.newSpanEventAlign(spanEventBo);
alignList.add(spanEventAlign);
}
return alignList;
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class Node method buildSpanChunkBaseAligns.
private List<Align> buildSpanChunkBaseAligns(List<SpanChunkBo> spanChunkBoList) {
if (CollectionUtils.isEmpty(spanChunkBoList)) {
return Collections.emptyList();
}
List<Align> alignList = new ArrayList<>();
for (SpanChunkBo chunkBo : spanChunkBoList) {
if (chunkBo.isAsyncSpanChunk()) {
// asyncSpanEvent
continue;
}
List<SpanEventBo> spanEventList = chunkBo.getSpanEventBoList();
for (SpanEventBo spanEventBo : spanEventList) {
if (logger.isTraceEnabled()) {
logger.trace("Populate spanEvent{seq={}, depth={}, event={}}", spanEventBo.getSequence(), spanEventBo.getDepth(), spanEventBo);
}
final Align spanEventAlign = this.newSpanEventAlign(chunkBo, spanEventBo);
alignList.add(spanEventAlign);
}
}
return alignList;
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class SpanAsyncEventMap method add.
private boolean add(SpanBo spanBo, final SpanChunkBo spanChunkBo) {
final LocalAsyncIdBo localAsyncId = spanChunkBo.getLocalAsyncId();
if (localAsyncId == null) {
return false;
}
List<SpanEventBo> spanEventBoList = spanChunkBo.getSpanEventBoList();
if (CollectionUtils.isEmpty(spanEventBoList)) {
return false;
}
final List<Align> alignList = toAlignList(spanBo, spanChunkBo, spanEventBoList);
final int id = localAsyncId.getAsyncId();
Map<Integer, List<Align>> subMap = map.computeIfAbsent(id, k -> new HashMap<>());
final int sequence = localAsyncId.getSequence();
final List<Align> exist = subMap.get(sequence);
if (exist != null) {
exist.addAll(alignList);
} else {
subMap.put(sequence, alignList);
}
return true;
}
Aggregations