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;
}
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"));
}
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));
}
}
Aggregations