use of com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor in project pinpoint by naver.
the class TFFileDescriptorMapperTest method mapTest.
@Test
public void mapTest() {
TFFileDescriptorMapper tFFileDescriptorMapper = new TFFileDescriptorMapper();
FileDescriptorBo fileDescriptorBo = new FileDescriptorBo();
fileDescriptorBo.setOpenFileDescriptorCount(30);
TFFileDescriptor tFFileDescriptor = tFFileDescriptorMapper.map(fileDescriptorBo);
assertEquals(tFFileDescriptor.getOpenFileDescriptorCount(), 30, 0);
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor 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.thrift.dto.flink.TFFileDescriptor in project pinpoint by naver.
the class TBaseFlatMapperTest method createTFAgentStatBatch4.
private TFAgentStatBatch createTFAgentStatBatch4() {
final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
tFAgentStatBatch.setStartTimestamp(1491274142454L);
tFAgentStatBatch.setAgentId(AGENT_ID);
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId(AGENT_ID);
tFAgentStat.setTimestamp(1491274143454L);
final TFFileDescriptor tFFileDescriptor = new TFFileDescriptor();
tFFileDescriptor.setOpenFileDescriptorCount(10);
tFAgentStat.setFileDescriptor(tFFileDescriptor);
final TFAgentStat tFAgentStat2 = new TFAgentStat();
tFAgentStat2.setAgentId(AGENT_ID);
tFAgentStat2.setTimestamp(1491274148454L);
final TFFileDescriptor tFFileDescriptor2 = new TFFileDescriptor();
tFFileDescriptor2.setOpenFileDescriptorCount(20);
tFAgentStat2.setFileDescriptor(tFFileDescriptor2);
final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
tFAgentStatList.add(tFAgentStat);
tFAgentStatList.add(tFAgentStat2);
tFAgentStatBatch.setAgentStats(tFAgentStatList);
return tFAgentStatBatch;
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor in project pinpoint by naver.
the class TFFileDescriptorMapper method map.
public TFFileDescriptor map(FileDescriptorBo fileDescriptorBo) {
TFFileDescriptor tfFFileDescriptor = new TFFileDescriptor();
tfFFileDescriptor.setOpenFileDescriptorCount(fileDescriptorBo.getOpenFileDescriptorCount());
return tfFFileDescriptor;
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor in project pinpoint by naver.
the class JoinFileDescriptorBoMapper method map.
@Override
public JoinFileDescriptorBo map(TFAgentStat tFAgentStat) {
if (!tFAgentStat.isSetFileDescriptor()) {
return JoinFileDescriptorBo.EMPTY_JOIN_FILE_DESCRIPTOR_BO;
}
JoinFileDescriptorBo joinFileDescriptorBo = new JoinFileDescriptorBo();
final String agentId = tFAgentStat.getAgentId();
joinFileDescriptorBo.setId(agentId);
joinFileDescriptorBo.setTimestamp(tFAgentStat.getTimestamp());
TFFileDescriptor tFFileDescriptor = tFAgentStat.getFileDescriptor();
final long openFileDescriptorCount = tFFileDescriptor.getOpenFileDescriptorCount();
joinFileDescriptorBo.setOpenFdCountJoinValue(new JoinLongFieldBo(openFileDescriptorCount, openFileDescriptorCount, agentId, openFileDescriptorCount, agentId));
return joinFileDescriptorBo;
}
Aggregations