Search in sources :

Example 1 with Dot

use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.

the class DotExtractor method getApplicationScatterData.

public Map<Application, ScatterData> getApplicationScatterData(long from, long to, int xGroupUnitMillis, int yGroupUnitMillis) {
    Map<Application, ScatterData> applicationScatterDataMap = new HashMap<>();
    for (Map.Entry<Application, List<Dot>> entry : this.dotMap.entrySet()) {
        Application application = entry.getKey();
        List<Dot> dotList = entry.getValue();
        ScatterData scatterData = new ScatterData(from, to, xGroupUnitMillis, yGroupUnitMillis);
        scatterData.addDot(dotList);
        applicationScatterDataMap.put(application, scatterData);
    }
    return applicationScatterDataMap;
}
Also used : HashMap(java.util.HashMap) Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) ScatterData(com.navercorp.pinpoint.web.scatter.ScatterData)

Example 2 with Dot

use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.

the class HbaseApplicationTraceIndexDao method scanTraceScatter.

/**
     *
     */
@Override
public List<Dot> scanTraceScatter(String applicationName, SelectedScatterArea area, TransactionId offsetTransactionId, int offsetTransactionElapsed, int limit) {
    if (applicationName == null) {
        throw new NullPointerException("applicationName must not be null");
    }
    if (area == null) {
        throw new NullPointerException("range must not be null");
    }
    if (limit < 0) {
        throw new IllegalArgumentException("negative limit:" + limit);
    }
    logger.debug("scanTraceScatter");
    Scan scan = createScan(applicationName, area.getTimeRange());
    // method 1
    // not used yet. instead, use another row mapper (testing)
    // scan.setFilter(makeResponseTimeFilter(area, offsetTransactionId, offsetTransactionElapsed));
    // method 2
    ResponseTimeRange responseTimeRange = area.getResponseTimeRange();
    TraceIndexScatterMapper2 mapper = new TraceIndexScatterMapper2(responseTimeRange.getFrom(), responseTimeRange.getTo());
    List<List<Dot>> dotListList = hbaseOperations2.findParallel(HBaseTables.APPLICATION_TRACE_INDEX, scan, traceIdRowKeyDistributor, limit, mapper, APPLICATION_TRACE_INDEX_NUM_PARTITIONS);
    List<Dot> result = new ArrayList<>();
    for (List<Dot> dotList : dotListList) {
        result.addAll(dotList);
    }
    return result;
}
Also used : TraceIndexScatterMapper2(com.navercorp.pinpoint.web.mapper.TraceIndexScatterMapper2) ResponseTimeRange(com.navercorp.pinpoint.web.vo.ResponseTimeRange) ArrayList(java.util.ArrayList) Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) Scan(org.apache.hadoop.hbase.client.Scan) FilterList(org.apache.hadoop.hbase.filter.FilterList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 3 with Dot

use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.

the class TraceIndexScatterMapper method mapRow.

@Override
public List<Dot> mapRow(Result result, int rowNum) throws Exception {
    if (result.isEmpty()) {
        return Collections.emptyList();
    }
    Cell[] rawCells = result.rawCells();
    List<Dot> list = new ArrayList<>(rawCells.length);
    for (Cell cell : rawCells) {
        final Dot dot = createDot(cell);
        list.add(dot);
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) Cell(org.apache.hadoop.hbase.Cell)

Example 4 with Dot

use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.

the class TraceIndexScatterMapper2 method mapRow.

@Override
public List<Dot> mapRow(Result result, int rowNum) throws Exception {
    if (result.isEmpty()) {
        return Collections.emptyList();
    }
    Cell[] rawCells = result.rawCells();
    List<Dot> list = new ArrayList<>(rawCells.length);
    for (Cell cell : rawCells) {
        final Dot dot = createDot(cell);
        if (dot != null) {
            list.add(dot);
        }
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) Cell(org.apache.hadoop.hbase.Cell)

Example 5 with Dot

use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.

the class ScatterData method addDot.

public void addDot(Dot dot) {
    if (dot == null) {
        return;
    }
    long acceptedTimeDiff = dot.getAcceptedTime() - from;
    long x = acceptedTimeDiff - (acceptedTimeDiff % xGroupUnitMillis);
    if (x < 0) {
        x = 0L;
    }
    int y = dot.getElapsedTime() - (dot.getElapsedTime() % yGroupUnitMillis);
    Coordinates coordinates = new Coordinates(x, y);
    addDot(coordinates, new Dot(dot.getTransactionId(), acceptedTimeDiff, dot.getElapsedTime(), dot.getExceptionCode(), dot.getAgentId()));
    if (oldestAcceptedTime > dot.getAcceptedTime()) {
        oldestAcceptedTime = dot.getAcceptedTime();
    }
    if (latestAcceptedTime < dot.getAcceptedTime()) {
        latestAcceptedTime = dot.getAcceptedTime();
    }
}
Also used : Dot(com.navercorp.pinpoint.web.vo.scatter.Dot)

Aggregations

Dot (com.navercorp.pinpoint.web.vo.scatter.Dot)19 TransactionId (com.navercorp.pinpoint.common.util.TransactionId)9 ArrayList (java.util.ArrayList)8 List (java.util.List)5 Test (org.junit.Test)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)3 OffsetFixedBuffer (com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer)3 ScatterData (com.navercorp.pinpoint.web.scatter.ScatterData)3 Cell (org.apache.hadoop.hbase.Cell)3 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 TraceIndexScatterMapper2 (com.navercorp.pinpoint.web.mapper.TraceIndexScatterMapper2)1 DotGroup (com.navercorp.pinpoint.web.scatter.DotGroup)1 ResponseTimeRange (com.navercorp.pinpoint.web.vo.ResponseTimeRange)1 ApplicationScatterScanResult (com.navercorp.pinpoint.web.vo.scatter.ApplicationScatterScanResult)1 ScatterScanResult (com.navercorp.pinpoint.web.vo.scatter.ScatterScanResult)1 Random (java.util.Random)1 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)1 Scan (org.apache.hadoop.hbase.client.Scan)1