use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo 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.common.server.bo.stat.join.JoinLongFieldBo 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.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class JoinMemorySamplerTest method sampleDataPointsTest.
@Test
public void sampleDataPointsTest() throws Exception {
long currentTime = 1487149800000L;
List<JoinMemoryBo> joinMemoryBoList = createJoinMemoryBoList(currentTime);
AggreJoinMemoryBo aggreJoinMemoryBo = new JoinMemorySampler().sampleDataPoints(1, currentTime, joinMemoryBoList, JoinMemoryBo.EMPTY_JOIN_MEMORY_BO);
assertEquals(aggreJoinMemoryBo.getId(), ID);
assertEquals(aggreJoinMemoryBo.getTimestamp(), currentTime);
assertEquals(aggreJoinMemoryBo.getHeapUsedJoinValue(), new JoinLongFieldBo(3000L, 100L, "app_4_1", 8000L, "app_3_2"));
assertEquals(aggreJoinMemoryBo.getNonHeapUsedJoinValue(), new JoinLongFieldBo(300L, 50L, "app_1_3", 2900L, "app_5_4"));
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class JoinTotalThreadSamplerTest method sampleDataPoints.
@Test
public void sampleDataPoints() {
JoinTotalThreadCountSampler joinTotalThreadCountSampler = new JoinTotalThreadCountSampler();
List<JoinTotalThreadCountBo> joinTotalThreadCountBoList = new ArrayList<>(5);
long timeStamp = new Date().getTime();
joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 5000, 11, 60, "agent1_1", 20, "agent1_2"));
joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 10000, 22, 52, "agent2_1", 10, "agent2_2"));
joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 15000, 33, 39, "agent3_1", 90, "agent3_2"));
joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 20000, 44, 42, "agent4_1", 25, "agent4_2"));
joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 25000, 55, 55, "agent5_1", 54, "agent5_2"));
AggreJoinTotalThreadCountBo aggreJoinTotalThraedCountBo = joinTotalThreadCountSampler.sampleDataPoints(0, new Date().getTime(), joinTotalThreadCountBoList, new JoinTotalThreadCountBo());
assertEquals(aggreJoinTotalThraedCountBo.getId(), "testApp");
assertEquals(aggreJoinTotalThraedCountBo.getTotalThreadCountJoinValue(), new JoinLongFieldBo(33L, 39L, "agent3_1", 90L, "agent3_2"));
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class JoinLoadedClassSamplerTest method sampleDataPoints.
@Test
public void sampleDataPoints() {
JoinLoadedClassSampler joinLoadedClassSampler = new JoinLoadedClassSampler();
List<JoinLoadedClassBo> joinLoadedClassBoList = new ArrayList<>(5);
long timeStamp = new Date().getTime();
joinLoadedClassBoList.add(new JoinLoadedClassBo("testApp", 11, 60, "agent1_1", 20, "agent1_2", 11, 60, "agent1_1", 20, "agent1_2", timeStamp + 5000));
joinLoadedClassBoList.add(new JoinLoadedClassBo("testApp", 22, 52, "agent2_1", 10, "agent2_2", 22, 52, "agent2_1", 10, "agent2_2", timeStamp + 10000));
joinLoadedClassBoList.add(new JoinLoadedClassBo("testApp", 33, 39, "agent3_1", 90, "agent3_2", 33, 39, "agent3_1", 90, "agent3_2", timeStamp + 15000));
joinLoadedClassBoList.add(new JoinLoadedClassBo("testApp", 44, 42, "agent4_1", 25, "agent4_2", 44, 42, "agent4_1", 25, "agent4_2", timeStamp + 20000));
joinLoadedClassBoList.add(new JoinLoadedClassBo("testApp", 55, 55, "agent5_1", 54, "agent5_2", 55, 55, "agent5_1", 54, "agent5_2", timeStamp + 25000));
AggreJoinLoadedClassBo aggreJoinLoadedClassBo = joinLoadedClassSampler.sampleDataPoints(0, new Date().getTime(), joinLoadedClassBoList, new JoinLoadedClassBo());
assertEquals(aggreJoinLoadedClassBo.getId(), "testApp");
assertEquals(aggreJoinLoadedClassBo.getLoadedClassJoinValue(), new JoinLongFieldBo(33L, 10L, "agent2_2", 60L, "agent1_1"));
assertEquals(aggreJoinLoadedClassBo.getUnloadedClassJoinValue(), new JoinLongFieldBo(33L, 10L, "agent2_2", 60L, "agent1_1"));
}
Aggregations