Search in sources :

Example 6 with Dot

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

the class ScatterDataTest method addDotTest2.

@Test
public void addDotTest2() throws Exception {
    long from = 1000;
    long to = 10000;
    int xGroupUnit = 100;
    int yGroupUnit = 100;
    ScatterData scatterData = new ScatterData(from, to, xGroupUnit, yGroupUnit);
    long currentTime = System.currentTimeMillis();
    TransactionId transactionId1 = new TransactionId(transactionAgentId, currentTime, 1);
    TransactionId transactionId2 = new TransactionId(transactionAgentId, currentTime, 2);
    long acceptedTime = Math.max(Math.abs(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE)), from);
    int executionTime = (int) Math.abs(ThreadLocalRandom.current().nextLong(60 * 1000));
    long acceptedTime2 = Math.max(Math.abs(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE)), from);
    Dot dot1 = new Dot(transactionId1, acceptedTime2, executionTime, 0, agentId);
    Dot dot2 = new Dot(transactionId2, acceptedTime2, executionTime, 1, agentId);
    scatterData.addDot(dot1);
    scatterData.addDot(dot2);
    Map<Long, DotGroups> scatterDataMap = scatterData.getScatterDataMap();
    Collection<DotGroups> values = scatterDataMap.values();
    Assert.assertTrue(values.size() == 1);
    for (DotGroups dotGroups : values) {
        Map<Dot, DotGroup> dotGroupLeaders = dotGroups.getDotGroupLeaders();
        Assert.assertTrue(dotGroupLeaders.keySet().size() == 2);
    }
}
Also used : Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) TransactionId(com.navercorp.pinpoint.common.util.TransactionId) Test(org.junit.Test)

Example 7 with Dot

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

the class ScatterDataTest method addDotTest.

@Test
public void addDotTest() 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.addDot(dot);
    }
    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 8 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 9 with Dot

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

the class DotExtractor method getApplicationScatterScanResult.

public List<ApplicationScatterScanResult> getApplicationScatterScanResult() {
    List<ApplicationScatterScanResult> applicationScatterScanResult = new ArrayList<>();
    for (Map.Entry<Application, List<Dot>> entry : this.dotMap.entrySet()) {
        List<Dot> dotList = entry.getValue();
        Application application = entry.getKey();
        ScatterScanResult scatterScanResult = new ScatterScanResult(range.getFrom(), range.getTo(), dotList);
        applicationScatterScanResult.add(new ApplicationScatterScanResult(application, scatterScanResult));
    }
    return applicationScatterScanResult;
}
Also used : ArrayList(java.util.ArrayList) ApplicationScatterScanResult(com.navercorp.pinpoint.web.vo.scatter.ApplicationScatterScanResult) Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) ArrayList(java.util.ArrayList) List(java.util.List) ApplicationScatterScanResult(com.navercorp.pinpoint.web.vo.scatter.ApplicationScatterScanResult) ScatterScanResult(com.navercorp.pinpoint.web.vo.scatter.ScatterScanResult) HashMap(java.util.HashMap) Map(java.util.Map)

Example 10 with Dot

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

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