use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo in project pinpoint by naver.
the class MemoryCodecTest method createJoinMemoryBoList.
private List<JoinStatBo> createJoinMemoryBoList(long currentTime) {
final String id = "test_app";
List<JoinStatBo> joinMemoryBoList = new ArrayList<JoinStatBo>();
JoinMemoryBo joinMemoryBo1 = new JoinMemoryBo(id, currentTime, 3000, 2000, 5000, "app_1_1", "app_1_2", 500, 50, 600, "app_1_3", "app_1_4");
JoinMemoryBo joinMemoryBo2 = new JoinMemoryBo(id, currentTime + 5000, 4000, 1000, 7000, "app_2_1", "app_2_2", 400, 150, 600, "app_2_3", "app_2_4");
JoinMemoryBo joinMemoryBo3 = new JoinMemoryBo(id, currentTime + 10000, 5000, 3000, 8000, "app_3_1", "app_3_2", 200, 100, 200, "app_3_3", "app_3_4");
JoinMemoryBo joinMemoryBo4 = new JoinMemoryBo(id, currentTime + 15000, 1000, 100, 3000, "app_4_1", "app_4_2", 100, 900, 1000, "app_4_3", "app_4_4");
JoinMemoryBo joinMemoryBo5 = new JoinMemoryBo(id, currentTime + 20000, 2000, 1000, 6000, "app_5_1", "app_5_2", 300, 100, 2900, "app_5_3", "app_5_4");
joinMemoryBoList.add(joinMemoryBo1);
joinMemoryBoList.add(joinMemoryBo3);
joinMemoryBoList.add(joinMemoryBo2);
joinMemoryBoList.add(joinMemoryBo5);
joinMemoryBoList.add(joinMemoryBo4);
return joinMemoryBoList;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo 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.JoinMemoryBo in project pinpoint by naver.
the class JoinMemoryBoMapperTest method map2Test.
@Test
public void map2Test() {
final JoinMemoryBoMapper joinMemoryBoMapper = new JoinMemoryBoMapper();
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId(TEST_AGENT);
tFAgentStat.setTimestamp(1491274138454L);
JoinMemoryBo joinMemoryBo = joinMemoryBoMapper.map(tFAgentStat);
assertEquals(joinMemoryBo, joinMemoryBo.EMPTY_JOIN_MEMORY_BO);
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo in project pinpoint by naver.
the class JoinMemoryBoMapper method build.
@Override
public void build(TFAgentStat tFAgentStat, JoinAgentStatBo.Builder builder) {
JoinMemoryBo joinMemoryBo = this.map(tFAgentStat);
if (joinMemoryBo == JoinMemoryBo.EMPTY_JOIN_MEMORY_BO) {
return;
}
builder.addMemory(joinMemoryBo);
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo 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