use of com.navercorp.pinpoint.web.vo.stat.AggreJoinDirectBufferBo in project pinpoint by naver.
the class JoinDirectBufferSampler method sampleDataPoints.
@Override
public AggreJoinDirectBufferBo sampleDataPoints(int timeWindowIndex, long timestamp, List<JoinDirectBufferBo> joinDirectBufferBoList, JoinDirectBufferBo previousDataPoint) {
if (CollectionUtils.isEmpty(joinDirectBufferBoList)) {
return AggreJoinDirectBufferBo.createUncollectedObject(timestamp);
}
JoinDirectBufferBo joinDirectBufferBo = JoinDirectBufferBo.joinDirectBufferBoList(joinDirectBufferBoList, timestamp);
String id = joinDirectBufferBo.getId();
final JoinLongFieldBo directCountJoinValue = joinDirectBufferBo.getDirectCountJoinValue();
final JoinLongFieldBo directMemoryUsedJoinValue = joinDirectBufferBo.getDirectMemoryUsedJoinValue();
final JoinLongFieldBo mappedCountJoinValue = joinDirectBufferBo.getMappedCountJoinValue();
final JoinLongFieldBo mappedMemoryUsedJoinValue = joinDirectBufferBo.getMappedMemoryUsedJoinValue();
AggreJoinDirectBufferBo aggreJoinDirectBufferBo = new AggreJoinDirectBufferBo(id, directCountJoinValue, directMemoryUsedJoinValue, mappedCountJoinValue, mappedMemoryUsedJoinValue, timestamp);
return aggreJoinDirectBufferBo;
}
use of com.navercorp.pinpoint.web.vo.stat.AggreJoinDirectBufferBo in project pinpoint by naver.
the class ApplicationDirectBufferChartGroupTest method createApplicationDirectBufferChartGroupTest.
@Test
public void createApplicationDirectBufferChartGroupTest() {
long time = 1495418083250L;
Range range = Range.newRange(time - 240000, time);
TimeWindow timeWindow = new TimeWindow(range);
List<AggreJoinDirectBufferBo> aggreDirectBufferList = new ArrayList<>(5);
AggreJoinDirectBufferBo aggreJoinDirectBufferBo1 = new AggreJoinDirectBufferBo("testApp", 11, 60, "agent1_1", 20, "agent1_2", 11, 60, "agent1_1", 20, "agent1_2", 11, 60, "agent1_1", 20, "agent1_2", 11, 60, "agent1_1", 20, "agent1_2", time);
AggreJoinDirectBufferBo aggreJoinDirectBufferBo2 = new AggreJoinDirectBufferBo("testApp", 22, 52, "agent2_1", 10, "agent2_2", 22, 52, "agent2_1", 10, "agent2_2", 22, 52, "agent2_1", 10, "agent2_2", 22, 52, "agent2_1", 10, "agent2_2", time - 60000);
AggreJoinDirectBufferBo aggreJoinDirectBufferBo3 = new AggreJoinDirectBufferBo("testApp", 33, 39, "agent3_1", 9, "agent3_2", 33, 39, "agent3_1", 9, "agent3_2", 33, 39, "agent3_1", 9, "agent3_2", 33, 39, "agent3_1", 9, "agent3_2", time - 120000);
AggreJoinDirectBufferBo aggreJoinDirectBufferBo4 = new AggreJoinDirectBufferBo("testApp", 44, 42, "agent4_1", 25, "agent4_2", 44, 42, "agent4_1", 25, "agent4_2", 44, 42, "agent4_1", 25, "agent4_2", 44, 42, "agent4_1", 25, "agent4_2", time - 180000);
AggreJoinDirectBufferBo aggreJoinDirectBufferBo5 = new AggreJoinDirectBufferBo("testApp", 55, 55, "agent5_1", 54, "agent5_2", 55, 55, "agent5_1", 54, "agent5_2", 55, 55, "agent5_1", 54, "agent5_2", 55, 55, "agent5_1", 54, "agent5_2", time - 240000);
aggreDirectBufferList.add(aggreJoinDirectBufferBo1);
aggreDirectBufferList.add(aggreJoinDirectBufferBo2);
aggreDirectBufferList.add(aggreJoinDirectBufferBo3);
aggreDirectBufferList.add(aggreJoinDirectBufferBo4);
aggreDirectBufferList.add(aggreJoinDirectBufferBo5);
StatChartGroup applicationDirectBufferChartGroup = new ApplicationDirectBufferChart.ApplicationDirectBufferChartGroup(timeWindow, aggreDirectBufferList);
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationDirectBufferChartGroup.getCharts();
assertEquals(4, charts.size());
Chart directCountChart = charts.get(ApplicationDirectBufferChart.ApplicationDirectBufferChartGroup.DirectBufferChartType.DIRECT_COUNT);
List<Point> directCountPoints = directCountChart.getPoints();
assertEquals(5, directCountPoints.size());
int index = directCountPoints.size();
for (Point point : directCountPoints) {
testDirectCount((LongApplicationStatPoint) point, aggreDirectBufferList.get(--index));
}
Chart directMemoryUsedChart = charts.get(ApplicationDirectBufferChart.ApplicationDirectBufferChartGroup.DirectBufferChartType.DIRECT_MEMORY_USED);
List<Point> directMemoryUsedPoints = directMemoryUsedChart.getPoints();
assertEquals(5, directMemoryUsedPoints.size());
index = directMemoryUsedPoints.size();
for (Point point : directMemoryUsedPoints) {
testDirectMemoryUsed((LongApplicationStatPoint) point, aggreDirectBufferList.get(--index));
}
Chart mappedCountChart = charts.get(ApplicationDirectBufferChart.ApplicationDirectBufferChartGroup.DirectBufferChartType.MAPPED_COUNT);
List<Point> mappeedCountPoints = mappedCountChart.getPoints();
assertEquals(5, mappeedCountPoints.size());
index = mappeedCountPoints.size();
for (Point point : mappeedCountPoints) {
testMappedCount((LongApplicationStatPoint) point, aggreDirectBufferList.get(--index));
}
Chart mappedMemoryUsedChart = charts.get(ApplicationDirectBufferChart.ApplicationDirectBufferChartGroup.DirectBufferChartType.MAPPED_MEMORY_USED);
List<Point> mappedMemoryUsedPoints = mappedMemoryUsedChart.getPoints();
assertEquals(5, mappedMemoryUsedPoints.size());
index = mappedMemoryUsedPoints.size();
for (Point point : mappedMemoryUsedPoints) {
testMappedMemoryUsed((LongApplicationStatPoint) point, aggreDirectBufferList.get(--index));
}
}
use of com.navercorp.pinpoint.web.vo.stat.AggreJoinDirectBufferBo in project pinpoint by naver.
the class JoinDirectBufferSamplerTest method sampleDataPoints.
@Test
public void sampleDataPoints() throws Exception {
JoinDirectBufferSampler joinDirectBufferSampler = new JoinDirectBufferSampler();
List<JoinDirectBufferBo> joinDirectBufferBoList = new ArrayList<>(5);
long timeStamp = new Date().getTime();
joinDirectBufferBoList.add(new JoinDirectBufferBo("testApp", 11, 60, "agent1_1", 20, "agent1_2", 10, 60, "agent1_3", 47, "agent1_4", 11, 61, "agent1_5", 21, "agent1_6", 10, 60, "agent1_7", 46, "agent1_8", timeStamp + 5000));
joinDirectBufferBoList.add(new JoinDirectBufferBo("testApp", 22, 52, "agent2_1", 10, "agent2_2", 20, 70, "agent2_3", 24, "agent2_4", 22, 53, "agent2_5", 11, "agent2_6", 20, 70, "agent2_7", 23, "agent2_8", timeStamp + 10000));
joinDirectBufferBoList.add(new JoinDirectBufferBo("testApp", 33, 39, "agent3_1", 90, "agent3_2", 30, 85, "agent3_3", 33, "agent3_4", 33, 40, "agent3_5", 91, "agent3_6", 30, 85, "agent3_7", 32, "agent3_8", timeStamp + 15000));
joinDirectBufferBoList.add(new JoinDirectBufferBo("testApp", 44, 42, "agent4_1", 25, "agent4_2", 40, 58, "agent4_3", 56, "agent4_4", 44, 43, "agent4_5", 26, "agent4_6", 40, 58, "agent4_7", 55, "agent4_8", timeStamp + 20000));
joinDirectBufferBoList.add(new JoinDirectBufferBo("testApp", 55, 55, "agent5_1", 54, "agent5_2", 50, 86, "agent5_3", 76, "agent5_4", 55, 56, "agent5_5", 55, "agent5_6", 50, 86, "agent5_7", 75, "agent5_8", timeStamp + 25000));
AggreJoinDirectBufferBo aggreJoinDirectBufferBo = joinDirectBufferSampler.sampleDataPoints(0, new Date().getTime(), joinDirectBufferBoList, new JoinDirectBufferBo());
assertEquals(aggreJoinDirectBufferBo.getId(), "testApp");
assertEquals(aggreJoinDirectBufferBo.getDirectCountJoinValue(), new JoinLongFieldBo(33L, 10L, "agent2_2", 60L, "agent1_1"));
assertEquals(aggreJoinDirectBufferBo.getDirectMemoryUsedJoinValue(), new JoinLongFieldBo(30L, 24L, "agent2_4", 86L, "agent5_3"));
assertEquals(aggreJoinDirectBufferBo.getId(), "testApp");
assertEquals(aggreJoinDirectBufferBo.getMappedCountJoinValue(), new JoinLongFieldBo(33L, 11L, "agent2_6", 61L, "agent1_5"));
assertEquals(aggreJoinDirectBufferBo.getMappedMemoryUsedJoinValue(), new JoinLongFieldBo(30L, 23L, "agent2_8", 86L, "agent5_7"));
}
Aggregations