Search in sources :

Example 41 with TFAgentStat

use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat in project pinpoint by naver.

the class JoinThriftActiveTraceBoMapperTest method mapTest.

@Test
public void mapTest() throws Exception {
    final TFAgentStat tFAgentStat = new TFAgentStat();
    final String id = "testAgent";
    tFAgentStat.setAgentId(id);
    tFAgentStat.setTimestamp(1491274148454L);
    final TFActiveTraceHistogram tFActiveTraceHistogram = new TFActiveTraceHistogram();
    List<Integer> activeTraceCount = new ArrayList<>(4);
    activeTraceCount.add(10);
    activeTraceCount.add(20);
    activeTraceCount.add(40);
    activeTraceCount.add(50);
    tFActiveTraceHistogram.setVersion((short) 2);
    tFActiveTraceHistogram.setHistogramSchemaType(1);
    tFActiveTraceHistogram.setActiveTraceCount(activeTraceCount);
    final TFActiveTrace tFActiveTrace = new TFActiveTrace();
    tFActiveTrace.setHistogram(tFActiveTraceHistogram);
    tFAgentStat.setActiveTrace(tFActiveTrace);
    final JoinActiveTraceBoMapper joinActiveTraceBoMapper = new JoinActiveTraceBoMapper();
    final JoinActiveTraceBo joinActiveTraceBo = joinActiveTraceBoMapper.map(tFAgentStat);
    assertNotNull(joinActiveTraceBo);
    assertEquals(joinActiveTraceBo.getId(), id);
    assertEquals(joinActiveTraceBo.getTimestamp(), 1491274148454L);
    assertEquals(joinActiveTraceBo.getVersion(), 2);
    assertEquals(joinActiveTraceBo.getHistogramSchemaType(), 1);
    assertEquals(joinActiveTraceBo.getTotalCountJoinValue(), new JoinIntFieldBo(120, 120, id, 120, id));
}
Also used : JoinIntFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinIntFieldBo) TFActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram) JoinActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo) ArrayList(java.util.ArrayList) TFActiveTrace(com.navercorp.pinpoint.thrift.dto.flink.TFActiveTrace) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) Test(org.junit.Test)

Example 42 with TFAgentStat

use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat in project pinpoint by naver.

the class JoinTotalThreadCountBoMapperTest method mapTest.

@Test
public void mapTest() throws Exception {
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId("testAgent");
    tFAgentStat.setTimestamp(1491274138454L);
    final TFTotalThreadCount tfTotalThreadCount = new TFTotalThreadCount();
    tfTotalThreadCount.setTotalThreadCount(50);
    tFAgentStat.setTotalThreadCount(tfTotalThreadCount);
    final JoinTotalThreadCountBoMapper mapper = new JoinTotalThreadCountBoMapper();
    final JoinTotalThreadCountBo joinTotalThreadCountBo = mapper.map(tFAgentStat);
    assertNotNull(joinTotalThreadCountBo);
    assertEquals(joinTotalThreadCountBo.getId(), "testAgent");
    assertEquals(joinTotalThreadCountBo.getTimestamp(), 1491274138454L);
    assertEquals(joinTotalThreadCountBo.getTotalThreadCountJoinValue(), new JoinLongFieldBo(50L, 50L, "testAgent", 50L, "testAgent"));
}
Also used : JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) TFTotalThreadCount(com.navercorp.pinpoint.thrift.dto.flink.TFTotalThreadCount) Test(org.junit.Test)

Example 43 with TFAgentStat

use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat in project pinpoint by naver.

the class JoinAgentStatBoMapperTest method mapTest.

@Test
public void mapTest() {
    final String agentId = "testAgent";
    final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper();
    final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
    tFAgentStatBatch.setStartTimestamp(1491274138454L);
    tFAgentStatBatch.setAgentId(agentId);
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId(agentId);
    tFAgentStat.setTimestamp(1491274148454L);
    final TFCpuLoad tFCpuLoad = new TFCpuLoad();
    tFCpuLoad.setJvmCpuLoad(10);
    tFCpuLoad.setSystemCpuLoad(30);
    tFAgentStat.setCpuLoad(tFCpuLoad);
    final TFAgentStat tFAgentStat2 = new TFAgentStat();
    tFAgentStat2.setAgentId(agentId);
    tFAgentStat2.setTimestamp(1491275148454L);
    final TFCpuLoad tFCpuLoad2 = new TFCpuLoad();
    tFCpuLoad2.setJvmCpuLoad(20);
    tFCpuLoad2.setSystemCpuLoad(50);
    tFAgentStat2.setCpuLoad(tFCpuLoad2);
    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<JoinCpuLoadBo> joinCpuLoadBoList = joinAgentStatBo.getJoinCpuLoadBoList();
    assertEquals(joinCpuLoadBoList.size(), 2);
    JoinCpuLoadBo joinCpuLoadBo = joinCpuLoadBoList.get(0);
    assertEquals(joinCpuLoadBo.getId(), agentId);
    assertEquals(joinCpuLoadBo.getTimestamp(), 1491274148454L);
    JoinDoubleFieldBo jvmCpuLoadJoinValue = joinCpuLoadBo.getJvmCpuLoadJoinValue();
    assertEquals(jvmCpuLoadJoinValue.getAvg(), 10, 0);
    assertEquals(jvmCpuLoadJoinValue.getMin(), 10, 0);
    assertEquals(jvmCpuLoadJoinValue.getMax(), 10, 0);
    JoinDoubleFieldBo systemCpuLoadJoinValue = joinCpuLoadBo.getSystemCpuLoadJoinValue();
    assertEquals(systemCpuLoadJoinValue.getAvg(), 30, 0);
    assertEquals(systemCpuLoadJoinValue.getMin(), 30, 0);
    assertEquals(systemCpuLoadJoinValue.getMax(), 30, 0);
    joinCpuLoadBo = joinCpuLoadBoList.get(1);
    assertEquals(joinCpuLoadBo.getId(), agentId);
    assertEquals(joinCpuLoadBo.getTimestamp(), 1491275148454L);
    jvmCpuLoadJoinValue = joinCpuLoadBo.getJvmCpuLoadJoinValue();
    assertEquals(jvmCpuLoadJoinValue.getAvg(), 20, 0);
    assertEquals(jvmCpuLoadJoinValue.getMin(), 20, 0);
    assertEquals(jvmCpuLoadJoinValue.getMax(), 20, 0);
    systemCpuLoadJoinValue = joinCpuLoadBo.getSystemCpuLoadJoinValue();
    assertEquals(systemCpuLoadJoinValue.getAvg(), 50, 0);
    assertEquals(systemCpuLoadJoinValue.getMin(), 50, 0);
    assertEquals(systemCpuLoadJoinValue.getMax(), 50, 0);
}
Also used : JoinAgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo) JoinCpuLoadBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinCpuLoadBo) TFCpuLoad(com.navercorp.pinpoint.thrift.dto.flink.TFCpuLoad) ArrayList(java.util.ArrayList) JoinDoubleFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinDoubleFieldBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) TFAgentStatBatch(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch) Test(org.junit.Test)

Aggregations

TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)43 Test (org.junit.Test)36 ArrayList (java.util.ArrayList)15 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)14 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)10 AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)9 JoinAgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo)8 TFJvmGc (com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc)4 TFResponseTime (com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime)4 JoinActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo)3 JoinCpuLoadBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinCpuLoadBo)3 JoinIntFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinIntFieldBo)3 JoinLoadedClassBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLoadedClassBo)3 JoinMemoryBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo)3 JoinResponseTimeBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo)3 JoinTotalThreadCountBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo)3 JoinTransactionBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo)3 TFActiveTrace (com.navercorp.pinpoint.thrift.dto.flink.TFActiveTrace)3 TFActiveTraceHistogram (com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram)3 TFCpuLoad (com.navercorp.pinpoint.thrift.dto.flink.TFCpuLoad)3