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());
}
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;
}
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;
}
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);
}
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;
}
Aggregations