Search in sources :

Example 1 with TFFileDescriptor

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);
}
Also used : FileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo) TFFileDescriptor(com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor) Test(org.junit.Test)

Example 2 with TFFileDescriptor

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);
}
Also used : TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinFileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo) TFFileDescriptor(com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor) Test(org.junit.Test)

Example 3 with TFFileDescriptor

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;
}
Also used : ArrayList(java.util.ArrayList) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) TFFileDescriptor(com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor) TFAgentStatBatch(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)

Example 4 with TFFileDescriptor

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;
}
Also used : TFFileDescriptor(com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor)

Example 5 with TFFileDescriptor

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;
}
Also used : JoinFileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) TFFileDescriptor(com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor)

Aggregations

TFFileDescriptor (com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor)5 JoinFileDescriptorBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo)2 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)2 Test (org.junit.Test)2 FileDescriptorBo (com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo)1 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)1 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)1 ArrayList (java.util.ArrayList)1