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