use of com.navercorp.pinpoint.web.vo.stat.AggreJoinFileDescriptorBo in project pinpoint by naver.
the class JoinFileDescriptorSampler method sampleDataPoints.
@Override
public AggreJoinFileDescriptorBo sampleDataPoints(int timeWindowIndex, long timestamp, List<JoinFileDescriptorBo> joinFileDescriptorBoList, JoinFileDescriptorBo previousDataPoint) {
if (CollectionUtils.isEmpty(joinFileDescriptorBoList)) {
return AggreJoinFileDescriptorBo.createUncollectedObject(timestamp);
}
JoinFileDescriptorBo joinFileDescriptorBo = JoinFileDescriptorBo.joinFileDescriptorBoList(joinFileDescriptorBoList, timestamp);
String id = joinFileDescriptorBo.getId();
final JoinLongFieldBo openFdCountJoinValue = joinFileDescriptorBo.getOpenFdCountJoinValue();
AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo = new AggreJoinFileDescriptorBo(id, openFdCountJoinValue, timestamp);
return aggreJoinFileDescriptorBo;
}
use of com.navercorp.pinpoint.web.vo.stat.AggreJoinFileDescriptorBo in project pinpoint by naver.
the class ApplicationFileDescriptorChartGroupTest method createApplicationFileDescriptorChartGroupTest.
@Test
public void createApplicationFileDescriptorChartGroupTest() {
long time = 1495418083250L;
Range range = Range.newRange(time - 240000, time);
TimeWindow timeWindow = new TimeWindow(range);
List<AggreJoinFileDescriptorBo> aggreFileDescriptorList = new ArrayList<>(5);
AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo1 = new AggreJoinFileDescriptorBo("testApp", 11, 60, "agent1_1", 20, "agent1_2", time);
AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo2 = new AggreJoinFileDescriptorBo("testApp", 22, 52, "agent2_1", 10, "agent2_2", time - 60000);
AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo3 = new AggreJoinFileDescriptorBo("testApp", 33, 39, "agent3_1", 9, "agent3_2", time - 120000);
AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo4 = new AggreJoinFileDescriptorBo("testApp", 44, 42, "agent4_1", 25, "agent4_2", time - 180000);
AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo5 = new AggreJoinFileDescriptorBo("testApp", 55, 55, "agent5_1", 54, "agent5_2", time - 240000);
aggreFileDescriptorList.add(aggreJoinFileDescriptorBo1);
aggreFileDescriptorList.add(aggreJoinFileDescriptorBo2);
aggreFileDescriptorList.add(aggreJoinFileDescriptorBo3);
aggreFileDescriptorList.add(aggreJoinFileDescriptorBo4);
aggreFileDescriptorList.add(aggreJoinFileDescriptorBo5);
StatChartGroup applicationFileDescriptorChartGroup = new ApplicationFileDescriptorChart.ApplicationFileDescriptorChartGroup(timeWindow, aggreFileDescriptorList);
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationFileDescriptorChartGroup.getCharts();
assertEquals(1, charts.size());
Chart fileDescriptorChart = charts.get(ApplicationFileDescriptorChart.ApplicationFileDescriptorChartGroup.FileDescriptorChartType.OPEN_FILE_DESCRIPTOR_COUNT);
List<Point> fileDescriptorPoints = fileDescriptorChart.getPoints();
assertEquals(5, fileDescriptorPoints.size());
int index = fileDescriptorPoints.size();
for (Point point : fileDescriptorPoints) {
testOpenFileDescriptor((LongApplicationStatPoint) point, aggreFileDescriptorList.get(--index));
}
}
use of com.navercorp.pinpoint.web.vo.stat.AggreJoinFileDescriptorBo in project pinpoint by naver.
the class JoinFileDescriptorSamplerTest method sampleDataPoints.
@Test
public void sampleDataPoints() throws Exception {
JoinFileDescriptorSampler joinFileDescriptorSampler = new JoinFileDescriptorSampler();
List<JoinFileDescriptorBo> joinFileDescriptorBoList = new ArrayList<>(5);
long timeStamp = new Date().getTime();
joinFileDescriptorBoList.add(new JoinFileDescriptorBo("testApp", 11, 60, "agent1_1", 20, "agent1_2", timeStamp + 5000));
joinFileDescriptorBoList.add(new JoinFileDescriptorBo("testApp", 22, 52, "agent2_1", 10, "agent2_2", timeStamp + 10000));
joinFileDescriptorBoList.add(new JoinFileDescriptorBo("testApp", 33, 39, "agent3_1", 90, "agent3_2", timeStamp + 15000));
joinFileDescriptorBoList.add(new JoinFileDescriptorBo("testApp", 44, 42, "agent4_1", 25, "agent4_2", timeStamp + 20000));
joinFileDescriptorBoList.add(new JoinFileDescriptorBo("testApp", 55, 55, "agent5_1", 54, "agent5_2", timeStamp + 25000));
AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo = joinFileDescriptorSampler.sampleDataPoints(0, new Date().getTime(), joinFileDescriptorBoList, new JoinFileDescriptorBo());
assertEquals(aggreJoinFileDescriptorBo.getId(), "testApp");
assertEquals(aggreJoinFileDescriptorBo.getOpenFdCountJoinValue(), new JoinLongFieldBo(33L, 10L, "agent2_2", 60L, "agent1_1"));
}
Aggregations