Search in sources :

Example 1 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class SpanUtils method getTransactionId.

@Deprecated
public static byte[] getTransactionId(TSpanChunk spanChunk) {
    if (spanChunk == null) {
        throw new NullPointerException("spanChunk must not be null");
    }
    final byte[] transactionIdBytes = spanChunk.getTransactionId();
    final TransactionId transactionId = TransactionIdUtils.parseTransactionId(transactionIdBytes);
    String agentId = transactionId.getAgentId();
    if (agentId == null) {
        agentId = spanChunk.getAgentId();
    }
    return BytesUtils.stringLongLongToBytes(agentId, AGENT_NAME_MAX_LEN, transactionId.getAgentStartTime(), transactionId.getTransactionSequence());
}
Also used : TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 2 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class SpanDecoder method decodeSpanBo.

public SpanBo decodeSpanBo(Buffer qualifier, Buffer valueBuffer, SpanDecodingContext decodingContext) {
    TransactionId transactionId = decodingContext.getTransactionId();
    SpanBo spanBo = new SpanBo();
    spanBo.setTransactionId(transactionId);
    long spanId = qualifier.readLong();
    spanBo.setSpanId(spanId);
    spanBo.setCollectorAcceptTime(decodingContext.getCollectorAcceptedTime());
    readSpan(spanBo, valueBuffer);
    if (logger.isDebugEnabled()) {
        logger.debug("read span :{}", spanBo);
    }
    return spanBo;
}
Also used : SpanBo(com.navercorp.pinpoint.common.server.bo.SpanBo) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 3 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class SpanFactory method newSpanBo.

// for test
SpanBo newSpanBo(TSpan tSpan) {
    final SpanBo spanBo = new SpanBo();
    spanBo.setAgentId(tSpan.getAgentId());
    spanBo.setApplicationId(tSpan.getApplicationName());
    spanBo.setAgentStartTime(tSpan.getAgentStartTime());
    final TransactionId transactionId = newTransactionId(tSpan.getTransactionId(), spanBo);
    spanBo.setTransactionId(transactionId);
    spanBo.setSpanId(tSpan.getSpanId());
    spanBo.setParentSpanId(tSpan.getParentSpanId());
    spanBo.setStartTime(tSpan.getStartTime());
    spanBo.setElapsed(tSpan.getElapsed());
    spanBo.setRpc(tSpan.getRpc());
    spanBo.setServiceType(tSpan.getServiceType());
    spanBo.setEndPoint(tSpan.getEndPoint());
    spanBo.setFlag(tSpan.getFlag());
    spanBo.setApiId(tSpan.getApiId());
    spanBo.setErrCode(tSpan.getErr());
    spanBo.setAcceptorHost(tSpan.getAcceptorHost());
    spanBo.setRemoteAddr(tSpan.getRemoteAddr());
    spanBo.setLoggingTransactionInfo(tSpan.getLoggingTransactionInfo());
    // applicationServiceType is not saved for older versions where applicationServiceType does not exist.
    if (tSpan.isSetApplicationServiceType()) {
        spanBo.setApplicationServiceType(tSpan.getApplicationServiceType());
    } else {
        spanBo.setApplicationServiceType(tSpan.getServiceType());
    }
    spanBo.setParentApplicationId(tSpan.getParentApplicationName());
    spanBo.setParentApplicationServiceType(tSpan.getParentApplicationType());
    // FIXME span.errCode contains error of span and spanEvent
    // because exceptionInfo is the error information of span itself, exceptionInfo can be null even if errCode is not 0
    final TIntStringValue exceptionInfo = tSpan.getExceptionInfo();
    if (exceptionInfo != null) {
        spanBo.setExceptionInfo(exceptionInfo.getIntValue(), exceptionInfo.getStringValue());
    }
    List<AnnotationBo> annotationBoList = buildAnnotationList(tSpan.getAnnotations());
    spanBo.setAnnotationBoList(annotationBoList);
    return spanBo;
}
Also used : TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 4 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class FilteredMapServiceImpl method selectApplicationMap.

@Override
public ApplicationMap selectApplicationMap(TransactionId transactionId) {
    if (transactionId == null) {
        throw new NullPointerException("transactionId must not be null");
    }
    List<TransactionId> transactionIdList = new ArrayList<>();
    transactionIdList.add(transactionId);
    // FIXME from,to -1
    Range range = new Range(-1, -1);
    return selectApplicationMap(transactionIdList, range, range, Filter.NONE);
}
Also used : ArrayList(java.util.ArrayList) Range(com.navercorp.pinpoint.web.vo.Range) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 5 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class FilteredMapServiceImpl method recursiveCallFilter.

private List<TransactionId> recursiveCallFilter(List<TransactionId> transactionIdList) {
    if (transactionIdList == null) {
        throw new NullPointerException("transactionIdList must not be null");
    }
    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 Lists.newArrayList(filteredTransactionId);
    }
    return transactionIdList;
}
Also used : ArrayList(java.util.ArrayList) TransactionId(com.navercorp.pinpoint.common.util.TransactionId) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

TransactionId (com.navercorp.pinpoint.common.util.TransactionId)44 ArrayList (java.util.ArrayList)11 Dot (com.navercorp.pinpoint.web.vo.scatter.Dot)9 Test (org.junit.Test)9 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)8 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)8 OffsetFixedBuffer (com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer)7 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)5 List (java.util.List)5 Put (org.apache.hadoop.hbase.client.Put)4 ByteBuffer (java.nio.ByteBuffer)3 Cell (org.apache.hadoop.hbase.Cell)3 SpanChunkBo (com.navercorp.pinpoint.common.server.bo.SpanChunkBo)2 TSpan (com.navercorp.pinpoint.thrift.dto.TSpan)2 TSpanEvent (com.navercorp.pinpoint.thrift.dto.TSpanEvent)2 ScatterData (com.navercorp.pinpoint.web.scatter.ScatterData)2 LimitedScanResult (com.navercorp.pinpoint.web.vo.LimitedScanResult)2 Get (org.apache.hadoop.hbase.client.Get)2 Scan (org.apache.hadoop.hbase.client.Scan)2 FilterList (org.apache.hadoop.hbase.filter.FilterList)2