use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class MetaSpanCallTreeFactory method unknown.
public CallTree unknown(final long startTimeMillis) {
final SpanBo rootSpan = new SpanBo();
rootSpan.setTransactionId(new TransactionId(UNKNOWN_AGENT_ID, AGENT_START_TIME, 0));
rootSpan.setAgentId(UNKNOWN_AGENT_ID);
rootSpan.setApplicationId("UNKNOWN");
rootSpan.setStartTime(startTimeMillis);
rootSpan.setServiceType(ServiceType.UNKNOWN.getCode());
List<AnnotationBo> annotations = new ArrayList<>();
ApiMetaDataBo apiMetaData = new ApiMetaDataBo(UNKNOWN_AGENT_ID, AGENT_START_TIME, 0, LineNumber.NO_LINE_NUMBER, MethodTypeEnum.WEB_REQUEST, "Unknown");
final AnnotationBo apiMetaDataAnnotation = new AnnotationBo(AnnotationKey.API_METADATA.getCode(), apiMetaData);
annotations.add(apiMetaDataAnnotation);
final AnnotationBo argumentAnnotation = new AnnotationBo(AnnotationKeyUtils.getArgs(0).getCode(), "No Agent Data");
annotations.add(argumentAnnotation);
rootSpan.setAnnotationBoList(annotations);
return new MetaSpanCallTree(new SpanAlign(rootSpan, true));
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class ScatterChartController method selectFilterScatterData.
private ScatterView.DotView selectFilterScatterData(String applicationName, Range range, int xGroupUnit, int yGroupUnit, int limit, boolean backwardDirection, String filterText) {
final LimitedScanResult<List<TransactionId>> limitedScanResult = flow.selectTraceIdsFromApplicationTraceIndex(applicationName, range, limit, backwardDirection);
final List<TransactionId> transactionIdList = limitedScanResult.getScanData();
if (logger.isTraceEnabled()) {
logger.trace("submitted transactionId count={}", transactionIdList.size());
}
final boolean requestComplete = transactionIdList.size() < limit;
transactionIdList.sort(TransactionIdComparator.INSTANCE);
Filter<List<SpanBo>> filter = filterBuilder.build(filterText);
ScatterData scatterData = scatter.selectScatterData(transactionIdList, applicationName, range, xGroupUnit, yGroupUnit, filter);
if (logger.isDebugEnabled()) {
logger.debug("getScatterData range scan(limited:{}, backwardDirection:{}) from ~ to:{} ~ {}, limited:{}, filterDataSize:{}", limit, backwardDirection, DateTimeFormatUtils.format(range.getFrom()), DateTimeFormatUtils.format(range.getTo()), DateTimeFormatUtils.format(limitedScanResult.getLimitedTime()), transactionIdList.size());
}
return new ScatterView.DotView(scatterData, requestComplete);
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class ScatterChartServiceImpl method selectScatterData.
@Override
public ScatterData selectScatterData(List<TransactionId> transactionIdList, String applicationName, Range range, int xGroupUnit, int yGroupUnit, Filter<List<SpanBo>> filter) {
Objects.requireNonNull(transactionIdList, "transactionIdList");
Objects.requireNonNull(applicationName, "applicationName");
Objects.requireNonNull(filter, "filter");
final List<List<SpanBo>> traceList = traceDao.selectAllSpans(transactionIdList);
populateAgentNameListOfList(traceList);
ScatterDataBuilder scatterData = new ScatterDataBuilder(range.getFrom(), range.getTo(), xGroupUnit, yGroupUnit);
for (List<SpanBo> trace : traceList) {
if (!filter.include(trace)) {
continue;
}
for (SpanBo span : trace) {
if (applicationName.equals(span.getApplicationId())) {
final TransactionId transactionId = span.getTransactionId();
final Dot dot = new Dot(transactionId, span.getCollectorAcceptTime(), span.getElapsed(), span.getErrCode(), span.getAgentId());
scatterData.addDot(dot);
}
}
}
return scatterData.build();
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class FilteredMapServiceImpl method recursiveCallFilter.
private List<TransactionId> recursiveCallFilter(List<TransactionId> transactionIdList) {
Objects.requireNonNull(transactionIdList, "transactionIdList");
List<TransactionId> crashKey = new ArrayList<>();
Map<TransactionId, Object> filterMap = new LinkedHashMap<>(transactionIdList.size());
for (TransactionId transactionId : transactionIdList) {
Object old = filterMap.put(transactionId, V);
if (old != null) {
crashKey.add(transactionId);
}
}
if (!crashKey.isEmpty()) {
Set<TransactionId> filteredTransactionId = filterMap.keySet();
logger.info("transactionId crash found. original:{} filter:{} crashKey:{}", transactionIdList.size(), filteredTransactionId.size(), crashKey);
return new ArrayList<>(filteredTransactionId);
}
return transactionIdList;
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class SpanFactory method newSpanChunkBo.
// for test
SpanChunkBo newSpanChunkBo(TSpanChunk tSpanChunk) {
final SpanChunkBo spanChunkBo = new SpanChunkBo();
spanChunkBo.setAgentId(tSpanChunk.getAgentId());
spanChunkBo.setApplicationId(tSpanChunk.getApplicationName());
spanChunkBo.setAgentStartTime(tSpanChunk.getAgentStartTime());
spanChunkBo.setServiceType(tSpanChunk.getServiceType());
if (tSpanChunk.isSetApplicationServiceType()) {
spanChunkBo.setApplicationServiceType(tSpanChunk.getApplicationServiceType());
} else {
spanChunkBo.setApplicationServiceType(tSpanChunk.getServiceType());
}
TransactionId transactionId = newTransactionId(tSpanChunk.getTransactionId(), spanChunkBo.getAgentId());
spanChunkBo.setTransactionId(transactionId);
spanChunkBo.setSpanId(tSpanChunk.getSpanId());
spanChunkBo.setEndPoint(tSpanChunk.getEndPoint());
return spanChunkBo;
}
Aggregations