Search in sources :

Example 6 with JoinLongFieldBo

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));
}
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 7 with JoinLongFieldBo

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

Example 8 with JoinLongFieldBo

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));
}
Also used : JoinAgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo) JoinResponseTimeBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo) ArrayList(java.util.ArrayList) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) TFResponseTime(com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime) TFAgentStatBatch(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch) Test(org.junit.Test)

Example 9 with JoinLongFieldBo

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

Example 10 with JoinLongFieldBo

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;
}
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

JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)54 ArrayList (java.util.ArrayList)18 Test (org.junit.Test)18 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)10 AgentStatHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder)8 BitCountingHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder)8 JoinLongFieldEncodingStrategy (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldEncodingStrategy)8 JoinStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo)8 JoinResponseTimeBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo)7 JoinTransactionBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo)7 JoinDirectBufferBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinDirectBufferBo)6 JoinLoadedClassBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLoadedClassBo)6 JoinTotalThreadCountBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo)6 JoinMemoryBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo)5 JoinAgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo)4 JoinFileDescriptorBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo)4 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)4 Date (java.util.Date)4 TFResponseTime (com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime)3 TFTransaction (com.navercorp.pinpoint.thrift.dto.flink.TFTransaction)3