Search in sources :

Example 1 with AggreJoinTotalThreadCountBo

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

the class JoinTotalThreadCountSampler method sampleDataPoints.

@Override
public AggreJoinTotalThreadCountBo sampleDataPoints(int index, long timestamp, List<JoinTotalThreadCountBo> dataPoints, JoinTotalThreadCountBo previousDataPoint) {
    if (CollectionUtils.isEmpty(dataPoints)) {
        return AggreJoinTotalThreadCountBo.createUncollectedObject(timestamp);
    }
    JoinTotalThreadCountBo joinTotalThreadCountBo = JoinTotalThreadCountBo.joinTotalThreadCountBoList(dataPoints, timestamp);
    String id = joinTotalThreadCountBo.getId();
    final JoinLongFieldBo totalThreadCountJoinValue = joinTotalThreadCountBo.getTotalThreadCountJoinValue();
    AggreJoinTotalThreadCountBo aggreJoinTotalThraedCountBo = new AggreJoinTotalThreadCountBo(id, timestamp, totalThreadCountJoinValue);
    return aggreJoinTotalThraedCountBo;
}
Also used : AggreJoinTotalThreadCountBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo) AggreJoinTotalThreadCountBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo) JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)

Example 2 with AggreJoinTotalThreadCountBo

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

the class JoinTotalThreadSamplerTest method sampleDataPoints.

@Test
public void sampleDataPoints() {
    JoinTotalThreadCountSampler joinTotalThreadCountSampler = new JoinTotalThreadCountSampler();
    List<JoinTotalThreadCountBo> joinTotalThreadCountBoList = new ArrayList<>(5);
    long timeStamp = new Date().getTime();
    joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 5000, 11, 60, "agent1_1", 20, "agent1_2"));
    joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 10000, 22, 52, "agent2_1", 10, "agent2_2"));
    joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 15000, 33, 39, "agent3_1", 90, "agent3_2"));
    joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 20000, 44, 42, "agent4_1", 25, "agent4_2"));
    joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 25000, 55, 55, "agent5_1", 54, "agent5_2"));
    AggreJoinTotalThreadCountBo aggreJoinTotalThraedCountBo = joinTotalThreadCountSampler.sampleDataPoints(0, new Date().getTime(), joinTotalThreadCountBoList, new JoinTotalThreadCountBo());
    assertEquals(aggreJoinTotalThraedCountBo.getId(), "testApp");
    assertEquals(aggreJoinTotalThraedCountBo.getTotalThreadCountJoinValue(), new JoinLongFieldBo(33L, 39L, "agent3_1", 90L, "agent3_2"));
}
Also used : AggreJoinTotalThreadCountBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo) ArrayList(java.util.ArrayList) AggreJoinTotalThreadCountBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo) JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) Date(java.util.Date) Test(org.junit.Test)

Example 3 with AggreJoinTotalThreadCountBo

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

the class ApplicationTotalThreadCountChartGroupTest method createApplicationTotalThreadCountChartGroupTest.

@Test
public void createApplicationTotalThreadCountChartGroupTest() {
    long time = 1495418083250L;
    Range range = Range.newRange(time - 240000, time);
    TimeWindow timeWindow = new TimeWindow(range);
    List<AggreJoinTotalThreadCountBo> aggreJoinTotalThreadCountBoList = new ArrayList<>(5);
    AggreJoinTotalThreadCountBo aggreJoinFileDescriptorBo1 = new AggreJoinTotalThreadCountBo("testApp", time, 11, 20, "agent1_1", 60, "agent1_2");
    AggreJoinTotalThreadCountBo aggreJoinFileDescriptorBo2 = new AggreJoinTotalThreadCountBo("testApp", time - 60000, 22, 10, "agent2_1", 52, "agent2_2");
    AggreJoinTotalThreadCountBo aggreJoinFileDescriptorBo3 = new AggreJoinTotalThreadCountBo("testApp", time - 120000, 33, 9, "agent3_1", 39, "agent3_2");
    AggreJoinTotalThreadCountBo aggreJoinFileDescriptorBo4 = new AggreJoinTotalThreadCountBo("testApp", time - 180000, 44, 25, "agent4_1", 42, "agent4_2");
    AggreJoinTotalThreadCountBo aggreJoinFileDescriptorBo5 = new AggreJoinTotalThreadCountBo("testApp", time - 240000, 55, 54, "agent5_1", 55, "agent5_2");
    aggreJoinTotalThreadCountBoList.add(aggreJoinFileDescriptorBo1);
    aggreJoinTotalThreadCountBoList.add(aggreJoinFileDescriptorBo2);
    aggreJoinTotalThreadCountBoList.add(aggreJoinFileDescriptorBo3);
    aggreJoinTotalThreadCountBoList.add(aggreJoinFileDescriptorBo4);
    aggreJoinTotalThreadCountBoList.add(aggreJoinFileDescriptorBo5);
    StatChartGroup applicationTotalThreadCountChartGroup = new ApplicationTotalThreadCountChart.ApplicationTotalThreadCountChartGroup(timeWindow, aggreJoinTotalThreadCountBoList);
    Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationTotalThreadCountChartGroup.getCharts();
    assertEquals(1, charts.size());
    Chart totalThreadCountChart = charts.get(ApplicationTotalThreadCountChart.ApplicationTotalThreadCountChartGroup.TotalThreadCountChartType.TOTAL_THREAD_COUNT);
    List<Point> totalThreadCountChartPoints = totalThreadCountChart.getPoints();
    assertEquals(5, totalThreadCountChartPoints.size());
    int index = totalThreadCountChartPoints.size();
    for (Point point : totalThreadCountChartPoints) {
        testTotalThreadCount((LongApplicationStatPoint) point, aggreJoinTotalThreadCountBoList.get(--index));
    }
}
Also used : AggreJoinTotalThreadCountBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo) 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) StatChartGroup(com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup) Chart(com.navercorp.pinpoint.web.vo.chart.Chart) Test(org.junit.Test)

Aggregations

AggreJoinTotalThreadCountBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo)3 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)2 JoinTotalThreadCountBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo)2 ArrayList (java.util.ArrayList)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 Date (java.util.Date)1