use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.
the class HbaseTraceDao method insert.
@Override
public void insert(final SpanBo spanBo) {
if (spanBo == null) {
throw new NullPointerException("span must not be null");
}
long acceptedTime = spanBo.getCollectorAcceptTime();
TransactionId transactionId = spanBo.getTransactionId();
final byte[] rowKey = rowKeyEncoder.encodeRowKey(transactionId);
final Put put = new Put(rowKey, acceptedTime);
this.spanSerializer.serialize(spanBo, put, null);
this.annotationSerializer.serialize(spanBo, put, null);
addNestedSpanEvent(put, spanBo);
boolean success = hbaseTemplate.asyncPut(TRACES, put);
if (!success) {
hbaseTemplate.put(TRACES, put);
}
}
use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.
the class ScatterChartController method selectFilterScatterData.
private ModelAndView selectFilterScatterData(String applicationName, Range range, int xGroupUnit, int yGroupUnit, int limit, boolean backwardDirection, String filterText, int version) {
final LimitedScanResult<List<TransactionId>> limitedScanResult = flow.selectTraceIdsFromApplicationTraceIndex(applicationName, range, limit, backwardDirection);
final List<TransactionId> transactionIdList = limitedScanResult.getScanData();
logger.trace("submitted transactionId count={}", transactionIdList.size());
boolean requestComplete = transactionIdList.size() < limit;
Collections.sort(transactionIdList, TransactionIdComparator.INSTANCE);
Filter filter = filterBuilder.build(filterText);
ModelAndView mv;
if (version == 1) {
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, DateUtils.longToDateStr(range.getFrom()), DateUtils.longToDateStr(range.getTo()), DateUtils.longToDateStr(limitedScanResult.getLimitedTime()), transactionIdList.size());
}
mv = createScatterDataV1(scatterData, requestComplete);
} else {
mv = new ModelAndView();
}
mv.addObject("currentServerTime", new ServerTime().getCurrentServerTime());
mv.addObject("from", range.getFrom());
mv.addObject("to", range.getTo());
return mv;
}
use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.
the class DotExtractor method addDot.
public void addDot(SpanBo span) {
if (span == null) {
throw new NullPointerException("span must not be null");
}
Application spanApplication = this.applicationFactory.createApplication(span.getApplicationId(), span.getApplicationServiceType());
final List<Dot> dotList = getDotList(spanApplication);
final TransactionId transactionId = span.getTransactionId();
final Dot dot = new Dot(transactionId, span.getCollectorAcceptTime(), span.getElapsed(), span.getErrCode(), span.getAgentId());
dotList.add(dot);
logger.trace("Application:{} Dot:{}", spanApplication, dot);
}
use of com.navercorp.pinpoint.common.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 filter) {
if (transactionIdList == null) {
throw new NullPointerException("transactionIdList must not be null");
}
if (applicationName == null) {
throw new NullPointerException("applicationName must not be null");
}
if (filter == null) {
throw new NullPointerException("filter must not be null");
}
final List<List<SpanBo>> traceList = traceDao.selectAllSpans(transactionIdList);
ScatterData scatterData = new ScatterData(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;
}
use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.
the class ScatterChartServiceImpl method selectScatterData.
@Override
public List<Dot> selectScatterData(List<TransactionId> transactionIdList, String applicationName, Filter filter) {
if (transactionIdList == null) {
throw new NullPointerException("transactionIdList must not be null");
}
if (applicationName == null) {
throw new NullPointerException("applicationName must not be null");
}
if (filter == null) {
throw new NullPointerException("filter must not be null");
}
final List<List<SpanBo>> traceList = traceDao.selectAllSpans(transactionIdList);
final List<Dot> result = new ArrayList<>();
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());
result.add(dot);
}
}
}
return result;
}
Aggregations