Search in sources :

Example 1 with TFLoadedClass

use of com.navercorp.pinpoint.thrift.dto.flink.TFLoadedClass in project pinpoint by naver.

the class JoinAgentStatBoMapperTest method map7Test.

@Test
public void map7Test() {
    final String agentId = "testAgent";
    final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper();
    final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
    tFAgentStatBatch.setStartTimestamp(1491274138454L);
    tFAgentStatBatch.setAgentId(agentId);
    final TFLoadedClass tfLoadedClass = new TFLoadedClass();
    tfLoadedClass.setLoadedClassCount(100);
    tfLoadedClass.setUnloadedClassCount(100);
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId(agentId);
    tFAgentStat.setTimestamp(1491274148454L);
    tFAgentStat.setLoadedClass(tfLoadedClass);
    final TFLoadedClass tfLoadedClass2 = new TFLoadedClass();
    tfLoadedClass2.setLoadedClassCount(120);
    tfLoadedClass2.setUnloadedClassCount(120);
    final TFAgentStat tFAgentStat2 = new TFAgentStat();
    tFAgentStat2.setAgentId(agentId);
    tFAgentStat2.setTimestamp(1491275148454L);
    tFAgentStat2.setLoadedClass(tfLoadedClass2);
    final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
    tFAgentStatList.add(tFAgentStat);
    tFAgentStatList.add(tFAgentStat2);
    tFAgentStatBatch.setAgentStats(tFAgentStatList);
    JoinAgentStatBo joinAgentStatBo = joinAgentStatBoMapper.map(tFAgentStatBatch);
    assertEquals(agentId, joinAgentStatBo.getId());
    assertEquals(1491274138454L, joinAgentStatBo.getAgentStartTimestamp());
    assertEquals(1491274148454L, joinAgentStatBo.getTimestamp());
    List<JoinLoadedClassBo> joinLoadedClassBoList = joinAgentStatBo.getJoinLoadedClassBoList();
    assertEquals(joinLoadedClassBoList.size(), 2);
    JoinLoadedClassBo joinLoadedClassBo = joinLoadedClassBoList.get(0);
    assertEquals(agentId, joinLoadedClassBo.getId());
    assertEquals(1491274148454L, joinLoadedClassBo.getTimestamp());
    assertEquals(new JoinLongFieldBo(100L, 100L, agentId, 100L, agentId), joinLoadedClassBo.getLoadedClassJoinValue());
    assertEquals(new JoinLongFieldBo(100L, 100L, agentId, 100L, agentId), joinLoadedClassBo.getUnloadedClassJoinValue());
    JoinLoadedClassBo joinLoadedClassBo2 = joinLoadedClassBoList.get(1);
    assertEquals(agentId, joinLoadedClassBo2.getId());
    assertEquals(1491275148454L, joinLoadedClassBo2.getTimestamp());
    assertEquals(new JoinLongFieldBo(120L, 120L, agentId, 120L, agentId), joinLoadedClassBo2.getLoadedClassJoinValue());
    assertEquals(new JoinLongFieldBo(120L, 120L, agentId, 120L, agentId), joinLoadedClassBo2.getUnloadedClassJoinValue());
}
Also used : JoinAgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo) ArrayList(java.util.ArrayList) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) JoinLoadedClassBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLoadedClassBo) TFAgentStatBatch(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch) TFLoadedClass(com.navercorp.pinpoint.thrift.dto.flink.TFLoadedClass) Test(org.junit.Test)

Example 2 with TFLoadedClass

use of com.navercorp.pinpoint.thrift.dto.flink.TFLoadedClass in project pinpoint by naver.

the class JoinLoadedClassBoMapperTest method mapTest.

@Test
public void mapTest() throws Exception {
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId("testAgent");
    tFAgentStat.setTimestamp(1491274138454L);
    final TFLoadedClass tfLoadedClass = new TFLoadedClass();
    tfLoadedClass.setLoadedClassCount(50);
    tfLoadedClass.setUnloadedClassCount(50);
    tFAgentStat.setLoadedClass(tfLoadedClass);
    final JoinLoadedClassBoMapper mapper = new JoinLoadedClassBoMapper();
    final JoinLoadedClassBo joinLoadedClassBo = mapper.map(tFAgentStat);
    assertNotNull(joinLoadedClassBo);
    assertEquals("testAgent", joinLoadedClassBo.getId());
    assertEquals(1491274138454L, joinLoadedClassBo.getTimestamp());
    assertEquals(new JoinLongFieldBo(50L, 50L, "testAgent", 50L, "testAgent"), joinLoadedClassBo.getLoadedClassJoinValue());
    assertEquals(new JoinLongFieldBo(50L, 50L, "testAgent", 50L, "testAgent"), joinLoadedClassBo.getUnloadedClassJoinValue());
}
Also used : TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) JoinLoadedClassBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLoadedClassBo) TFLoadedClass(com.navercorp.pinpoint.thrift.dto.flink.TFLoadedClass) Test(org.junit.Test)

Example 3 with TFLoadedClass

use of com.navercorp.pinpoint.thrift.dto.flink.TFLoadedClass in project pinpoint by naver.

the class TFLoadedClassCountMapperTest method mapTest.

@Test
public void mapTest() {
    TFLoadedClassMapper mapper = new TFLoadedClassMapper();
    LoadedClassBo loadedClassBo = new LoadedClassBo();
    loadedClassBo.setLoadedClassCount(50);
    loadedClassBo.setUnloadedClassCount(50);
    TFLoadedClass tfLoadedClass = mapper.map(loadedClassBo);
    assertEquals(tfLoadedClass.getLoadedClassCount(), 50);
    assertEquals(tfLoadedClass.getUnloadedClassCount(), 50);
}
Also used : LoadedClassBo(com.navercorp.pinpoint.common.server.bo.stat.LoadedClassBo) TFLoadedClass(com.navercorp.pinpoint.thrift.dto.flink.TFLoadedClass) Test(org.junit.Test)

Example 4 with TFLoadedClass

use of com.navercorp.pinpoint.thrift.dto.flink.TFLoadedClass in project pinpoint by naver.

the class TFLoadedClassMapper method map.

public TFLoadedClass map(LoadedClassBo loadedClassBo) {
    TFLoadedClass tFLoadedClass = new TFLoadedClass();
    tFLoadedClass.setLoadedClassCount(loadedClassBo.getLoadedClassCount());
    tFLoadedClass.setUnloadedClassCount(loadedClassBo.getUnloadedClassCount());
    return tFLoadedClass;
}
Also used : TFLoadedClass(com.navercorp.pinpoint.thrift.dto.flink.TFLoadedClass)

Aggregations

TFLoadedClass (com.navercorp.pinpoint.thrift.dto.flink.TFLoadedClass)4 Test (org.junit.Test)3 JoinLoadedClassBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLoadedClassBo)2 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)2 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)2 LoadedClassBo (com.navercorp.pinpoint.common.server.bo.stat.LoadedClassBo)1 JoinAgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo)1 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)1 ArrayList (java.util.ArrayList)1