Search in sources :

Example 1 with AggreJoinActiveTraceBo

use of com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo in project pinpoint by naver.

the class JoinActiveTraceSampler method sampleDataPoints.

@Override
public AggreJoinActiveTraceBo sampleDataPoints(int index, long timestamp, List<JoinActiveTraceBo> joinActiveTraceBoList, JoinActiveTraceBo previousDataPoint) {
    if (CollectionUtils.isEmpty(joinActiveTraceBoList)) {
        return AggreJoinActiveTraceBo.createUncollectedObject(timestamp);
    }
    JoinActiveTraceBo joinActiveTraceBo = JoinActiveTraceBo.joinActiveTraceBoList(joinActiveTraceBoList, timestamp);
    String id = joinActiveTraceBo.getId();
    int histogramSchemaType = joinActiveTraceBo.getHistogramSchemaType();
    short version = joinActiveTraceBo.getVersion();
    JoinIntFieldBo totalCountValue = joinActiveTraceBo.getTotalCountJoinValue();
    AggreJoinActiveTraceBo aggreJoinActiveTraceBo = new AggreJoinActiveTraceBo(id, histogramSchemaType, version, totalCountValue, timestamp);
    return aggreJoinActiveTraceBo;
}
Also used : JoinIntFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinIntFieldBo) JoinActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo) AggreJoinActiveTraceBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo) AggreJoinActiveTraceBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo)

Example 2 with AggreJoinActiveTraceBo

use of com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo in project pinpoint by naver.

the class JoinActiveTraceSamplerTest method sampleDataPointsTest.

@Test
public void sampleDataPointsTest() {
    long currentTime = 1487149800000L;
    JoinActiveTraceSampler sampler = new JoinActiveTraceSampler();
    List<JoinActiveTraceBo> joinActiveTraceBoList = createJoinActiveTraceBoList(currentTime);
    AggreJoinActiveTraceBo aggreJoinActiveTraceBo = sampler.sampleDataPoints(1, currentTime, joinActiveTraceBoList, JoinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO);
    assertEquals(aggreJoinActiveTraceBo.getId(), "test_app");
    assertEquals(aggreJoinActiveTraceBo.getHistogramSchemaType(), 1);
    assertEquals(aggreJoinActiveTraceBo.getVersion(), 2);
    assertEquals(aggreJoinActiveTraceBo.getTotalCountJoinValue(), new JoinIntFieldBo(130, 10, "app_1_1", 560, "app_4_2"));
    assertEquals(aggreJoinActiveTraceBo.getTimestamp(), 1487149800000L);
}
Also used : JoinIntFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinIntFieldBo) JoinActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo) AggreJoinActiveTraceBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo) AggreJoinActiveTraceBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo) Test(org.junit.Test)

Example 3 with AggreJoinActiveTraceBo

use of com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo in project pinpoint by naver.

the class ApplicationActiveTraceChartGroupTest method createApplicationActiveTraceChartGroupTest.

@Test
public void createApplicationActiveTraceChartGroupTest() {
    long time = 1495418083250L;
    String id = "testApp";
    Range range = Range.newRange(time - 240000, time);
    TimeWindow timeWindow = new TimeWindow(range);
    List<AggreJoinActiveTraceBo> aggreJoinActiveTraceBoList = new ArrayList<>(5);
    AggreJoinActiveTraceBo aggreJoinActiveTraceBo1 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 150, 10, "app_1_1", 230, "app_1_2", time);
    AggreJoinActiveTraceBo aggreJoinActiveTraceBo2 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 110, 22, "app_2_1", 330, "app_2_2", time - 60000);
    AggreJoinActiveTraceBo aggreJoinActiveTraceBo3 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 120, 24, "app_3_1", 540, "app_3_2", time - 120000);
    AggreJoinActiveTraceBo aggreJoinActiveTraceBo4 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 130, 25, "app_4_1", 560, "app_4_2", time - 180000);
    AggreJoinActiveTraceBo aggreJoinActiveTraceBo5 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 140, 12, "app_5_1", 260, "app_5_2", time - 240000);
    aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo1);
    aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo2);
    aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo3);
    aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo4);
    aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo5);
    StatChartGroup applicationActiveTraceChartGroup = new ApplicationActiveTraceChart.ApplicationActiveTraceChartGroup(timeWindow, aggreJoinActiveTraceBoList);
    Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationActiveTraceChartGroup.getCharts();
    Chart<? extends Point> activeTraceChart = charts.get(ApplicationActiveTraceChart.ApplicationActiveTraceChartGroup.ActiveTraceChartType.ACTIVE_TRACE_COUNT);
    List<? extends Point> activeTracePointList = activeTraceChart.getPoints();
    assertEquals(5, activeTracePointList.size());
    int index = activeTracePointList.size();
    for (Point point : activeTracePointList) {
        testActiveTraceCount((IntApplicationStatPoint) point, aggreJoinActiveTraceBoList.get(--index));
    }
}
Also used : ArrayList(java.util.ArrayList) Point(com.navercorp.pinpoint.web.vo.chart.Point) Range(com.navercorp.pinpoint.web.vo.Range) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) Point(com.navercorp.pinpoint.web.vo.chart.Point) AggreJoinActiveTraceBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo) StatChartGroup(com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup) Chart(com.navercorp.pinpoint.web.vo.chart.Chart) Test(org.junit.Test)

Aggregations

AggreJoinActiveTraceBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo)3 JoinActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo)2 JoinIntFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinIntFieldBo)2 Test (org.junit.Test)2 TimeWindow (com.navercorp.pinpoint.web.util.TimeWindow)1 Range (com.navercorp.pinpoint.web.vo.Range)1 Chart (com.navercorp.pinpoint.web.vo.chart.Chart)1 Point (com.navercorp.pinpoint.web.vo.chart.Point)1 StatChartGroup (com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup)1 ArrayList (java.util.ArrayList)1