Search in sources :

Example 31 with TFAgentStat

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

the class TFAgentStatMapperTest method map6Test.

@Test
public void map6Test() {
    AgentStatBo agentStatBo = createFileDescriptorBoList();
    List<TFAgentStat> tFAgentStatList = newAgentStatMapper().map(agentStatBo);
    assertEquals(3, tFAgentStatList.size());
    TFAgentStat tFAgentStat1 = tFAgentStatList.get(0);
    assertEquals(TEST_AGENT, tFAgentStat1.getAgentId());
    assertEquals(startTimestamp, tFAgentStat1.getStartTimestamp());
    assertEquals(collectTime1st, tFAgentStat1.getTimestamp());
    assertEquals(4, tFAgentStat1.getFileDescriptor().getOpenFileDescriptorCount(), 0);
    TFAgentStat tFAgentStat2 = tFAgentStatList.get(1);
    assertEquals(TEST_AGENT, tFAgentStat2.getAgentId());
    assertEquals(startTimestamp, tFAgentStat2.getStartTimestamp());
    assertEquals(collectTime2nd, tFAgentStat2.getTimestamp());
    assertEquals(5, tFAgentStat2.getFileDescriptor().getOpenFileDescriptorCount(), 0);
    TFAgentStat tFAgentStat3 = tFAgentStatList.get(2);
    assertEquals(TEST_AGENT, tFAgentStat3.getAgentId());
    assertEquals(startTimestamp, tFAgentStat3.getStartTimestamp());
    assertEquals(collectTime3rd, tFAgentStat3.getTimestamp());
    assertEquals(8, tFAgentStat3.getFileDescriptor().getOpenFileDescriptorCount(), 0);
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) Test(org.junit.Test)

Example 32 with TFAgentStat

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

the class JoinAgentStatBoMapperTest method map4Test.

@Test
public void map4Test() {
    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 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 TFAgentStat tFAgentStat2 = new TFAgentStat();
    tFAgentStat2.setAgentId(agentId);
    tFAgentStat2.setTimestamp(1491275148454L);
    tFAgentStat2.setCollectInterval(5000);
    final TFActiveTraceHistogram tFActiveTraceHistogram2 = new TFActiveTraceHistogram();
    List<Integer> activeTraceCount2 = new ArrayList<>(4);
    activeTraceCount2.add(11);
    activeTraceCount2.add(21);
    activeTraceCount2.add(41);
    activeTraceCount2.add(51);
    tFActiveTraceHistogram2.setVersion((short) 2);
    tFActiveTraceHistogram2.setHistogramSchemaType(1);
    tFActiveTraceHistogram2.setActiveTraceCount(activeTraceCount2);
    final TFActiveTrace tfActiveTrace2 = new TFActiveTrace();
    tfActiveTrace2.setHistogram(tFActiveTraceHistogram2);
    tFAgentStat2.setActiveTrace(tfActiveTrace2);
    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<JoinActiveTraceBo> joinActiveTraceBoList = joinAgentStatBo.getJoinActiveTraceBoList();
    assertEquals(joinActiveTraceBoList.size(), 2);
    JoinActiveTraceBo joinActiveTraceBo = joinActiveTraceBoList.get(0);
    assertEquals(joinActiveTraceBo.getId(), agentId);
    assertEquals(joinActiveTraceBo.getTimestamp(), 1491274148454L);
    assertEquals(joinActiveTraceBo.getVersion(), 2);
    assertEquals(joinActiveTraceBo.getHistogramSchemaType(), 1);
    assertEquals(joinActiveTraceBo.getTotalCountJoinValue(), new JoinIntFieldBo(120, 120, agentId, 120, agentId));
    JoinActiveTraceBo joinActiveTraceBo2 = joinActiveTraceBoList.get(1);
    assertEquals(joinActiveTraceBo2.getId(), agentId);
    assertEquals(joinActiveTraceBo2.getTimestamp(), 1491275148454L);
    assertEquals(joinActiveTraceBo2.getVersion(), 2);
    assertEquals(joinActiveTraceBo2.getHistogramSchemaType(), 1);
    assertEquals(joinActiveTraceBo2.getTotalCountJoinValue(), new JoinIntFieldBo(124, 124, agentId, 124, agentId));
}
Also used : ArrayList(java.util.ArrayList) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) TFAgentStatBatch(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch) JoinAgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo) 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) TFActiveTrace(com.navercorp.pinpoint.thrift.dto.flink.TFActiveTrace) Test(org.junit.Test)

Example 33 with TFAgentStat

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

the class JoinDirectBufferBoMapperTest method mapTest.

@Test
public void mapTest() throws Exception {
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId("testAgent");
    tFAgentStat.setTimestamp(1491274138454L);
    final TFDirectBuffer tfDirectBuffer = new TFDirectBuffer();
    tfDirectBuffer.setDirectCount(10);
    tfDirectBuffer.setDirectMemoryUsed(11);
    tfDirectBuffer.setMappedCount(12);
    tfDirectBuffer.setMappedMemoryUsed(13);
    tFAgentStat.setDirectBuffer(tfDirectBuffer);
    final JoinDirectBufferBoMapper mapper = new JoinDirectBufferBoMapper();
    final JoinDirectBufferBo joinDirectBufferBo = mapper.map(tFAgentStat);
    assertNotNull(joinDirectBufferBo);
    assertEquals(joinDirectBufferBo.getId(), "testAgent");
    assertEquals(joinDirectBufferBo.getTimestamp(), 1491274138454L);
    final JoinLongFieldBo directCountJoinValue = joinDirectBufferBo.getDirectCountJoinValue();
    assertEquals(directCountJoinValue.getAvg(), 10, 0);
    assertEquals(directCountJoinValue.getMin(), 10, 0);
    assertEquals(directCountJoinValue.getMax(), 10, 0);
    final JoinLongFieldBo directMemoryUsedJoinValue = joinDirectBufferBo.getDirectMemoryUsedJoinValue();
    assertEquals(directMemoryUsedJoinValue.getAvg(), 11, 0);
    assertEquals(directMemoryUsedJoinValue.getMin(), 11, 0);
    assertEquals(directMemoryUsedJoinValue.getMax(), 11, 0);
    final JoinLongFieldBo mappedCountJoinValue = joinDirectBufferBo.getMappedCountJoinValue();
    assertEquals(mappedCountJoinValue.getAvg(), 12, 0);
    assertEquals(mappedCountJoinValue.getMin(), 12, 0);
    assertEquals(mappedCountJoinValue.getMax(), 12, 0);
    final JoinLongFieldBo mappedMemoryUsedJoinValue = joinDirectBufferBo.getMappedMemoryUsedJoinValue();
    assertEquals(mappedMemoryUsedJoinValue.getAvg(), 13, 0);
    assertEquals(mappedMemoryUsedJoinValue.getMin(), 13, 0);
    assertEquals(mappedMemoryUsedJoinValue.getMax(), 13, 0);
}
Also used : JoinDirectBufferBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinDirectBufferBo) TFDirectBuffer(com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) Test(org.junit.Test)

Example 34 with TFAgentStat

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

the class JoinDirectBufferBoMapperTest method map2Test.

@Test
public void map2Test() {
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId("testAgent");
    tFAgentStat.setTimestamp(1491274138454L);
    final JoinDirectBufferBoMapper mapper = new JoinDirectBufferBoMapper();
    final JoinDirectBufferBo joinDirectBufferBo = mapper.map(tFAgentStat);
    assertEquals(joinDirectBufferBo, joinDirectBufferBo.EMPTY_JOIN_DIRECT_BUFFER_BO);
}
Also used : JoinDirectBufferBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinDirectBufferBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) Test(org.junit.Test)

Example 35 with TFAgentStat

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

the class JoinResponseTimeBoMapperTest method map2Test.

@Test
public void map2Test() {
    final String agentId = "agentId";
    final TFResponseTime tFResponseTime = new TFResponseTime();
    tFResponseTime.setAvg(100);
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId(agentId);
    tFAgentStat.setTimestamp(1491274148454L);
    JoinResponseTimeBoMapper mapper = new JoinResponseTimeBoMapper();
    JoinResponseTimeBo joinResponseTimeBo = mapper.map(tFAgentStat);
    assertEquals(joinResponseTimeBo, JoinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO);
}
Also used : JoinResponseTimeBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) TFResponseTime(com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime) 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