Search in sources :

Example 11 with Dot

use of com.navercorp.pinpoint.web.vo.scatter.Dot 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 12 with Dot

use of com.navercorp.pinpoint.web.vo.scatter.Dot 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)

Example 13 with Dot

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

the class ScatterDataSerializer method writeDotSet.

private void writeDotSet(DotGroups dotGroups, ScatterAgentMetaData metaData, JsonGenerator jgen) throws IOException {
    Map<Dot, DotGroup> dotGroupLeaders = dotGroups.getDotGroupLeaders();
    Set<Dot> dotSet = dotGroups.getSortedDotSet();
    for (Dot dot : dotSet) {
        if (dotGroupLeaders.containsKey(dot)) {
            writeDot(dot, dotGroupLeaders.get(dot).getDotSize(), metaData, jgen);
        } else {
            writeDot(dot, 0, metaData, jgen);
        }
    }
}
Also used : DotGroup(com.navercorp.pinpoint.web.scatter.DotGroup) Dot(com.navercorp.pinpoint.web.vo.scatter.Dot)

Example 14 with Dot

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

the class ScatterDataTest method mergeTest.

@Test
public void mergeTest() throws Exception {
    int count = 100;
    long from = 1000;
    long to = 10000;
    int xGroupUnit = 100;
    int yGroupUnit = 100;
    ScatterData scatterData = new ScatterData(from, to, xGroupUnit, yGroupUnit);
    List<Dot> dotList = createDotList(agentId, transactionAgentId, count, from);
    for (Dot dot : dotList) {
        ScatterData newScatterData = new ScatterData(from, to, xGroupUnit, yGroupUnit);
        newScatterData.addDot(dot);
        scatterData.merge(newScatterData);
    }
    List<Dot> dots = extractDotList(scatterData);
    Assert.assertEquals(count, dots.size());
}
Also used : Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) Test(org.junit.Test)

Example 15 with Dot

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

the class DotSerializerTest method testSerialize.

@Test
public void testSerialize() throws Exception {
    TransactionId transactionId = TransactionIdUtils.parseTransactionId("aigw.dev.1^1395798795017^1527177");
    Dot dot = new Dot(transactionId, 100, 99, 1, "agent");
    String jsonValue = mapper.writeValueAsString(dot);
    Assert.assertEquals("[100,99,\"aigw.dev.1^1395798795017^1527177\",0]", jsonValue);
}
Also used : Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) TransactionId(com.navercorp.pinpoint.common.util.TransactionId) Test(org.junit.Test)

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