Search in sources :

Example 6 with TransactionId

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));
}
Also used : AnnotationBo(com.navercorp.pinpoint.common.server.bo.AnnotationBo) ArrayList(java.util.ArrayList) ApiMetaDataBo(com.navercorp.pinpoint.common.server.bo.ApiMetaDataBo) SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId)

Example 7 with TransactionId

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);
}
Also used : List(java.util.List) ScatterData(com.navercorp.pinpoint.web.scatter.ScatterData) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId)

Example 8 with TransactionId

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();
}
Also used : Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) ArrayList(java.util.ArrayList) List(java.util.List) ScatterDataBuilder(com.navercorp.pinpoint.web.scatter.ScatterDataBuilder) SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId)

Example 9 with TransactionId

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;
}
Also used : ArrayList(java.util.ArrayList) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId) LinkedHashMap(java.util.LinkedHashMap)

Example 10 with TransactionId

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;
}
Also used : SpanChunkBo(com.navercorp.pinpoint.common.server.bo.SpanChunkBo) TransactionId(com.navercorp.pinpoint.common.profiler.util.TransactionId)

Aggregations

TransactionId (com.navercorp.pinpoint.common.profiler.util.TransactionId)51 Test (org.junit.Test)18 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)15 ArrayList (java.util.ArrayList)12 Dot (com.navercorp.pinpoint.web.vo.scatter.Dot)9 ByteBuffer (java.nio.ByteBuffer)6 List (java.util.List)6 AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)5 TraceId (com.navercorp.pinpoint.bootstrap.context.TraceId)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)4 SpanChunkBo (com.navercorp.pinpoint.common.server.bo.SpanChunkBo)4 DefaultTraceId (com.navercorp.pinpoint.profiler.context.id.DefaultTraceId)4 ColumnGetCount (com.navercorp.pinpoint.common.hbase.bo.ColumnGetCount)3 DefaultTraceRoot (com.navercorp.pinpoint.profiler.context.id.DefaultTraceRoot)3 TraceRoot (com.navercorp.pinpoint.profiler.context.id.TraceRoot)3 CallTreeIterator (com.navercorp.pinpoint.web.calltree.span.CallTreeIterator)3 SpanResult (com.navercorp.pinpoint.web.service.SpanResult)3 RecordSet (com.navercorp.pinpoint.web.vo.callstacks.RecordSet)3 TableName (org.apache.hadoop.hbase.TableName)3 GetMapping (org.springframework.web.bind.annotation.GetMapping)3