use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo 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.common.server.bo.stat.join.JoinFileDescriptorBo in project pinpoint by naver.
the class JoinFileDescriptorBoMapperTest method mapTest.
@Test
public void mapTest() throws Exception {
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId("testAgent");
tFAgentStat.setTimestamp(1491274138454L);
final TFFileDescriptor tfFileDescriptor = new TFFileDescriptor();
tfFileDescriptor.setOpenFileDescriptorCount(10);
tFAgentStat.setFileDescriptor(tfFileDescriptor);
final JoinFileDescriptorBoMapper mapper = new JoinFileDescriptorBoMapper();
final JoinFileDescriptorBo joinFileDescriptorBo = mapper.map(tFAgentStat);
assertNotNull(joinFileDescriptorBo);
assertEquals(joinFileDescriptorBo.getId(), "testAgent");
assertEquals(joinFileDescriptorBo.getTimestamp(), 1491274138454L);
assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getAvg(), 10, 0);
assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getMin(), 10, 0);
assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getMax(), 10, 0);
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo in project pinpoint by naver.
the class TBaseFlatMapperTest method assertJoinFileDescriptorBo.
private void assertJoinFileDescriptorBo(List<JoinFileDescriptorBo> joinFileDescriptorBoList) {
assertEquals(2, joinFileDescriptorBoList.size());
JoinFileDescriptorBo joinFileDescriptorBo = joinFileDescriptorBoList.get(0);
assertEquals(joinFileDescriptorBo.getId(), AGENT_ID);
assertEquals(joinFileDescriptorBo.getTimestamp(), 1491274143454L);
assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getAvg(), 10, 0);
assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getMin(), 10, 0);
assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getMax(), 10, 0);
joinFileDescriptorBo = joinFileDescriptorBoList.get(1);
assertEquals(joinFileDescriptorBo.getId(), AGENT_ID);
assertEquals(joinFileDescriptorBo.getTimestamp(), 1491274148454L);
assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getAvg(), 20, 0);
assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getMin(), 20, 0);
assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getMax(), 20, 0);
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo in project pinpoint by naver.
the class FileDescriptorCodecTest method createJoinFileDescriptorBoList.
private List<JoinStatBo> createJoinFileDescriptorBoList(long currentTime) {
final String id = "test_app";
final List<JoinStatBo> joinFileDescriptorBoList = new ArrayList<>();
JoinFileDescriptorBo joinFileDescriptorBo1 = new JoinFileDescriptorBo(id, 80, 1000, "agent1_1", 30, "agent1_2", currentTime);
JoinFileDescriptorBo joinFileDescriptorBo2 = new JoinFileDescriptorBo(id, 70, 900, "agent2_1", 20, "agent2_2", currentTime + 5000);
JoinFileDescriptorBo joinFileDescriptorBo4 = new JoinFileDescriptorBo(id, 60, 800, "agent4_1", 15, "agent4_2", currentTime + 15000);
JoinFileDescriptorBo joinFileDescriptorBo3 = new JoinFileDescriptorBo(id, 50, 700, "agent3_1", 10, "agent3_2", currentTime + 10000);
JoinFileDescriptorBo joinFileDescriptorBo5 = new JoinFileDescriptorBo(id, 40, 600, "agent5_1", 5, "agent5_2", currentTime + 20000);
joinFileDescriptorBoList.add(joinFileDescriptorBo1);
joinFileDescriptorBoList.add(joinFileDescriptorBo2);
joinFileDescriptorBoList.add(joinFileDescriptorBo3);
joinFileDescriptorBoList.add(joinFileDescriptorBo4);
joinFileDescriptorBoList.add(joinFileDescriptorBo5);
return joinFileDescriptorBoList;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo in project pinpoint by naver.
the class FileDescriptorCodec method encodeValues.
@Override
public void encodeValues(Buffer valueBuffer, List<JoinStatBo> joinFileDescriptorBoList) {
if (CollectionUtils.isEmpty(joinFileDescriptorBoList)) {
throw new IllegalArgumentException("fileDescriptorBoList must not be empty");
}
final int numValues = joinFileDescriptorBoList.size();
valueBuffer.putVInt(numValues);
List<Long> timestamps = new ArrayList<>(numValues);
JoinLongFieldStrategyAnalyzer.Builder openFileDescriptorCountAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
for (JoinStatBo joinStatBo : joinFileDescriptorBoList) {
JoinFileDescriptorBo joinFileDescriptorBo = (JoinFileDescriptorBo) joinStatBo;
timestamps.add(joinFileDescriptorBo.getTimestamp());
openFileDescriptorCountAnalyzerBuilder.addValue(joinFileDescriptorBo.getOpenFdCountJoinValue());
}
codec.encodeTimestamps(valueBuffer, timestamps);
encodeDataPoints(valueBuffer, openFileDescriptorCountAnalyzerBuilder.build());
}
Aggregations