use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class JoinMemoryBoMapperTest method map1Test.
@Test
public void map1Test() throws Exception {
final JoinMemoryBoMapper joinMemoryBoMapper = new JoinMemoryBoMapper();
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId(TEST_AGENT);
tFAgentStat.setTimestamp(1491274138454L);
final TFJvmGc tFJvmGc = new TFJvmGc();
tFJvmGc.setJvmMemoryHeapUsed(1000);
tFJvmGc.setJvmMemoryNonHeapUsed(300);
tFAgentStat.setGc(tFJvmGc);
JoinMemoryBo joinMemoryBo = joinMemoryBoMapper.map(tFAgentStat);
assertEquals(joinMemoryBo.getTimestamp(), 1491274138454L);
assertEquals(joinMemoryBo.getId(), TEST_AGENT);
assertEquals(joinMemoryBo.getHeapUsedJoinValue(), new JoinLongFieldBo(1000L, 1000L, TEST_AGENT, 1000L, TEST_AGENT));
assertEquals(joinMemoryBo.getNonHeapUsedJoinValue(), new JoinLongFieldBo(300L, 300L, TEST_AGENT, 300L, TEST_AGENT));
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class TBaseFlatMapperTest method assertJoinDirectBufferBo.
private void assertJoinDirectBufferBo(List<JoinDirectBufferBo> joinDirectBufferBoList) {
assertEquals(2, joinDirectBufferBoList.size());
JoinDirectBufferBo joinDirectBufferBo = joinDirectBufferBoList.get(0);
assertEquals(joinDirectBufferBo.getId(), AGENT_ID);
assertEquals(joinDirectBufferBo.getTimestamp(), 1491274143454L);
JoinLongFieldBo directCountJoinValue = joinDirectBufferBo.getDirectCountJoinValue();
assertEquals(directCountJoinValue.getAvg(), 10, 0);
assertEquals(directCountJoinValue.getMin(), 10, 0);
assertEquals(directCountJoinValue.getMax(), 10, 0);
JoinLongFieldBo directMemoryUsedJoinValue = joinDirectBufferBo.getDirectMemoryUsedJoinValue();
assertEquals(directMemoryUsedJoinValue.getAvg(), 20, 0);
assertEquals(directMemoryUsedJoinValue.getMin(), 20, 0);
assertEquals(directMemoryUsedJoinValue.getMax(), 20, 0);
JoinLongFieldBo mappedCountJoinValue = joinDirectBufferBo.getMappedCountJoinValue();
assertEquals(mappedCountJoinValue.getAvg(), 30, 0);
assertEquals(mappedCountJoinValue.getMin(), 30, 0);
assertEquals(mappedCountJoinValue.getMax(), 30, 0);
JoinLongFieldBo mappedMemoryUsedJoinValue = joinDirectBufferBo.getMappedMemoryUsedJoinValue();
assertEquals(mappedMemoryUsedJoinValue.getAvg(), 40, 0);
assertEquals(mappedMemoryUsedJoinValue.getMin(), 40, 0);
assertEquals(mappedMemoryUsedJoinValue.getMax(), 40, 0);
joinDirectBufferBo = joinDirectBufferBoList.get(1);
assertEquals(joinDirectBufferBo.getId(), AGENT_ID);
assertEquals(joinDirectBufferBo.getTimestamp(), 1491274148454L);
directCountJoinValue = joinDirectBufferBo.getDirectCountJoinValue();
assertEquals(directCountJoinValue.getAvg(), 50, 0);
assertEquals(directCountJoinValue.getMin(), 50, 0);
assertEquals(directCountJoinValue.getMax(), 50, 0);
directMemoryUsedJoinValue = joinDirectBufferBo.getDirectMemoryUsedJoinValue();
assertEquals(directMemoryUsedJoinValue.getAvg(), 60, 0);
assertEquals(directMemoryUsedJoinValue.getMin(), 60, 0);
assertEquals(directMemoryUsedJoinValue.getMax(), 60, 0);
mappedCountJoinValue = joinDirectBufferBo.getMappedCountJoinValue();
assertEquals(mappedCountJoinValue.getAvg(), 70, 0);
assertEquals(mappedCountJoinValue.getMin(), 70, 0);
assertEquals(mappedCountJoinValue.getMax(), 70, 0);
mappedMemoryUsedJoinValue = joinDirectBufferBo.getMappedMemoryUsedJoinValue();
assertEquals(mappedMemoryUsedJoinValue.getAvg(), 80, 0);
assertEquals(mappedMemoryUsedJoinValue.getMin(), 80, 0);
assertEquals(mappedMemoryUsedJoinValue.getMax(), 80, 0);
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class JoinAgentStatBoMapperTest method map5Test.
@Test
public void map5Test() {
final String agentId = "testAgent";
final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper();
final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
tFAgentStatBatch.setStartTimestamp(1491274138454L);
tFAgentStatBatch.setAgentId(agentId);
final TFResponseTime tFResponseTime = new TFResponseTime();
tFResponseTime.setAvg(100);
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId(agentId);
tFAgentStat.setTimestamp(1491274148454L);
tFAgentStat.setResponseTime(tFResponseTime);
final TFResponseTime tFResponseTime2 = new TFResponseTime();
tFResponseTime2.setAvg(120);
final TFAgentStat tFAgentStat2 = new TFAgentStat();
tFAgentStat2.setAgentId(agentId);
tFAgentStat2.setTimestamp(1491275148454L);
tFAgentStat2.setResponseTime(tFResponseTime2);
final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
tFAgentStatList.add(tFAgentStat);
tFAgentStatList.add(tFAgentStat2);
tFAgentStatBatch.setAgentStats(tFAgentStatList);
JoinAgentStatBo joinAgentStatBo = joinAgentStatBoMapper.map(tFAgentStatBatch);
assertEquals(joinAgentStatBo.getId(), agentId);
assertEquals(joinAgentStatBo.getAgentStartTimestamp(), 1491274138454L);
assertEquals(joinAgentStatBo.getTimestamp(), 1491274148454L);
List<JoinResponseTimeBo> joinResponseTimeBoList = joinAgentStatBo.getJoinResponseTimeBoList();
assertEquals(joinResponseTimeBoList.size(), 2);
JoinResponseTimeBo joinResponseTimeBo = joinResponseTimeBoList.get(0);
assertEquals(joinResponseTimeBo.getId(), agentId);
assertEquals(joinResponseTimeBo.getTimestamp(), 1491274148454L);
assertEquals(joinResponseTimeBo.getResponseTimeJoinValue(), new JoinLongFieldBo(100L, 100L, agentId, 100L, agentId));
JoinResponseTimeBo joinResponseTimeBo2 = joinResponseTimeBoList.get(1);
assertEquals(joinResponseTimeBo2.getId(), agentId);
assertEquals(joinResponseTimeBo2.getTimestamp(), 1491275148454L);
assertEquals(joinResponseTimeBo2.getResponseTimeJoinValue(), new JoinLongFieldBo(120L, 120L, agentId, 120L, agentId));
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class JoinDirectBufferBoMapper method map.
@Override
public JoinDirectBufferBo map(TFAgentStat tFAgentStat) {
if (!tFAgentStat.isSetDirectBuffer()) {
return JoinDirectBufferBo.EMPTY_JOIN_DIRECT_BUFFER_BO;
}
JoinDirectBufferBo joinDirectBufferBo = new JoinDirectBufferBo();
final String agentId = tFAgentStat.getAgentId();
joinDirectBufferBo.setId(agentId);
joinDirectBufferBo.setTimestamp(tFAgentStat.getTimestamp());
TFDirectBuffer tFDirectBuffer = tFAgentStat.getDirectBuffer();
final long directCount = tFDirectBuffer.getDirectCount();
joinDirectBufferBo.setDirectCountJoinValue(new JoinLongFieldBo(directCount, directCount, agentId, directCount, agentId));
final long directMemoryUsed = tFDirectBuffer.getDirectMemoryUsed();
joinDirectBufferBo.setDirectMemoryUsedJoinValue(new JoinLongFieldBo(directMemoryUsed, directMemoryUsed, agentId, directMemoryUsed, agentId));
final long mappedCount = tFDirectBuffer.getMappedCount();
joinDirectBufferBo.setMappedCountJoinValue(new JoinLongFieldBo(mappedCount, mappedCount, agentId, mappedCount, agentId));
final long mappedMemoryUsed = tFDirectBuffer.getMappedMemoryUsed();
joinDirectBufferBo.setMappedMemoryUsedJoinValue(new JoinLongFieldBo(mappedMemoryUsed, mappedMemoryUsed, agentId, mappedMemoryUsed, agentId));
return joinDirectBufferBo;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class JoinMemoryBoMapper method map.
public JoinMemoryBo map(TFAgentStat tFAgentStat) {
if (!tFAgentStat.isSetGc()) {
return JoinMemoryBo.EMPTY_JOIN_MEMORY_BO;
}
JoinMemoryBo joinMemoryBo = new JoinMemoryBo();
joinMemoryBo.setId(tFAgentStat.getAgentId());
TFJvmGc memory = tFAgentStat.getGc();
joinMemoryBo.setTimestamp(tFAgentStat.getTimestamp());
final String agentId = tFAgentStat.getAgentId();
final long jvmMemoryHeapUsed = memory.getJvmMemoryHeapUsed();
joinMemoryBo.setHeapUsedJoinValue(new JoinLongFieldBo(jvmMemoryHeapUsed, jvmMemoryHeapUsed, agentId, jvmMemoryHeapUsed, agentId));
final long jvmMemoryNonHeapUsed = memory.getJvmMemoryNonHeapUsed();
joinMemoryBo.setNonHeapUsedJoinValue(new JoinLongFieldBo(jvmMemoryNonHeapUsed, jvmMemoryNonHeapUsed, agentId, jvmMemoryNonHeapUsed, agentId));
return joinMemoryBo;
}
Aggregations