Search in sources :

Example 1 with JoinMemoryBo

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;
}
Also used : JoinMemoryBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo) ArrayList(java.util.ArrayList) JoinStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo)

Example 2 with JoinMemoryBo

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));
}
Also used : TFJvmGc(com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc) JoinMemoryBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) Test(org.junit.Test)

Example 3 with JoinMemoryBo

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);
}
Also used : JoinMemoryBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) Test(org.junit.Test)

Example 4 with JoinMemoryBo

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);
}
Also used : JoinMemoryBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo)

Example 5 with 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;
}
Also used : TFJvmGc(com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc) JoinMemoryBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)

Aggregations

JoinMemoryBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo)12 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)5 ArrayList (java.util.ArrayList)5 Test (org.junit.Test)4 JoinStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo)3 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)3 TFJvmGc (com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc)3 AggreJoinMemoryBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinMemoryBo)3 AgentStatHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder)1 BitCountingHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder)1 JoinLongFieldEncodingStrategy (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldEncodingStrategy)1 JoinLongFieldStrategyAnalyzer (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldStrategyAnalyzer)1 JoinAgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo)1 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)1