use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo in project pinpoint by naver.
the class TBaseFlatMapperTest method flatMapTest.
@Test
public void flatMapTest() throws Exception {
ApplicationCache applicationCache = newMockApplicationCache();
TBaseFlatMapper mapper = new TBaseFlatMapper(new JoinAgentStatBoMapper(), applicationCache, new DefaultTBaseFlatMapperInterceptor());
TFAgentStatBatch tfAgentStatBatch = createTFAgentStatBatch();
ArrayList<Tuple3<String, JoinStatBo, Long>> dataList = new ArrayList<>();
ListCollector<Tuple3<String, JoinStatBo, Long>> collector = new ListCollector<>(dataList);
RawData rawData = newRawData(tfAgentStatBatch);
mapper.flatMap(rawData, collector);
assertEquals(dataList.size(), 2);
Tuple3<String, JoinStatBo, Long> data1 = dataList.get(0);
assertEquals(data1.f0, AGENT_ID);
assertEquals(data1.f2.longValue(), 1491274143454L);
JoinAgentStatBo joinAgentStatBo = (JoinAgentStatBo) data1.f1;
assertEquals(joinAgentStatBo.getId(), AGENT_ID);
assertEquals(joinAgentStatBo.getAgentStartTimestamp(), 1491274142454L);
assertEquals(joinAgentStatBo.getTimestamp(), 1491274143454L);
assertJoinCpuLoadBo(joinAgentStatBo.getJoinCpuLoadBoList());
Tuple3<String, JoinStatBo, Long> data2 = dataList.get(1);
assertEquals(data2.f0, APPLICATION_ID);
assertEquals(data2.f2.longValue(), 1491274140000L);
JoinApplicationStatBo joinApplicationStatBo = (JoinApplicationStatBo) data2.f1;
assertEquals(joinApplicationStatBo.getId(), APPLICATION_ID);
assertEquals(joinApplicationStatBo.getTimestamp(), 1491274140000L);
assertEquals(joinApplicationStatBo.getStatType(), StatType.APP_STST);
assertJoinCpuLoadBo(joinApplicationStatBo.getJoinCpuLoadBoList());
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo in project pinpoint by naver.
the class TBaseFlatMapperTest method flatMap2Test.
@Test
public void flatMap2Test() throws Exception {
ApplicationCache applicationCache = newMockApplicationCache();
TBaseFlatMapper mapper = new TBaseFlatMapper(new JoinAgentStatBoMapper(), applicationCache, new DefaultTBaseFlatMapperInterceptor());
TFAgentStatBatch tfAgentStatBatch = createTFAgentStatBatch2();
ArrayList<Tuple3<String, JoinStatBo, Long>> dataList = new ArrayList<>();
ListCollector<Tuple3<String, JoinStatBo, Long>> collector = new ListCollector<>(dataList);
RawData rawdata = newRawData(tfAgentStatBatch);
mapper.flatMap(rawdata, collector);
assertEquals(dataList.size(), 2);
Tuple3<String, JoinStatBo, Long> data1 = dataList.get(0);
assertEquals(data1.f0, AGENT_ID);
assertEquals(data1.f2.longValue(), 1491274143454L);
JoinAgentStatBo joinAgentStatBo = (JoinAgentStatBo) data1.f1;
assertEquals(joinAgentStatBo.getId(), AGENT_ID);
assertEquals(joinAgentStatBo.getAgentStartTimestamp(), 1491274142454L);
assertEquals(joinAgentStatBo.getTimestamp(), 1491274143454L);
assertJoinMemoryBo(joinAgentStatBo.getJoinMemoryBoList());
Tuple3<String, JoinStatBo, Long> data2 = dataList.get(1);
assertEquals(data2.f0, APPLICATION_ID);
assertEquals(data2.f2.longValue(), 1491274140000L);
JoinApplicationStatBo joinApplicationStatBo = (JoinApplicationStatBo) data2.f1;
assertEquals(joinApplicationStatBo.getId(), APPLICATION_ID);
assertEquals(joinApplicationStatBo.getTimestamp(), 1491274140000L);
assertEquals(joinApplicationStatBo.getStatType(), StatType.APP_STST);
assertJoinMemoryBo(joinApplicationStatBo.getJoinMemoryBoList());
}
Aggregations