Search in sources :

Example 16 with TransactionId

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);
    }
}
Also used : Put(org.apache.hadoop.hbase.client.Put) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 17 with TransactionId

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;
}
Also used : Filter(com.navercorp.pinpoint.web.filter.Filter) ModelAndView(org.springframework.web.servlet.ModelAndView) List(java.util.List) ServerTime(com.navercorp.pinpoint.web.view.ServerTime) ScatterData(com.navercorp.pinpoint.web.scatter.ScatterData) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 18 with TransactionId

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

Example 19 with TransactionId

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

Example 20 with TransactionId

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

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