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());
}
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());
}
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);
}
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;
}
Aggregations