use of com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram in project pinpoint by naver.
the class TFActiveTraceMapperTest method mapTest.
@Test
public void mapTest() {
ActiveTraceBo activeTraceBo = new ActiveTraceBo();
activeTraceBo.setAgentId(TEST_AGENT);
activeTraceBo.setVersion((short) 1);
activeTraceBo.setStartTimestamp(startTimestamp);
activeTraceBo.setTimestamp(timestamp);
activeTraceBo.setHistogramSchemaType(1);
ActiveTraceHistogram activeTraceHistogram = new ActiveTraceHistogram(30, 40, 10, 50);
activeTraceBo.setActiveTraceHistogram(activeTraceHistogram);
TFActiveTraceMapper mapper = new TFActiveTraceMapper();
TFActiveTrace tFActiveTrace = mapper.map(activeTraceBo);
TFActiveTraceHistogram histogram = tFActiveTrace.getHistogram();
assertEquals(1, histogram.getVersion());
assertEquals(1, histogram.getHistogramSchemaType());
List<Integer> activeTraceCountList = histogram.getActiveTraceCount();
assertEquals(4, activeTraceCountList.size());
assertEquals(30, (int) activeTraceCountList.get(0));
assertEquals(40, (int) activeTraceCountList.get(1));
assertEquals(10, (int) activeTraceCountList.get(2));
assertEquals(50, (int) activeTraceCountList.get(3));
}
use of com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram in project pinpoint by naver.
the class TFAgentStatMapperTest method createActiveTraceBoList.
private AgentStatBo createActiveTraceBoList() {
AgentStatBo.Builder builder = newBuilder();
ActiveTraceBo activeTraceBo1 = new ActiveTraceBo();
activeTraceBo1.setVersion((short) 1);
activeTraceBo1.setHistogramSchemaType(2);
ActiveTraceHistogram activeTraceHistogram1 = new ActiveTraceHistogram(30, 40, 10, 50);
activeTraceBo1.setActiveTraceHistogram(activeTraceHistogram1);
AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
statBuilder1.addActiveTrace(activeTraceBo1);
ActiveTraceBo activeTraceBo2 = new ActiveTraceBo();
activeTraceBo2.setTimestamp(collectTime2nd);
activeTraceBo2.setVersion((short) 1);
activeTraceBo2.setHistogramSchemaType(2);
ActiveTraceHistogram activeTraceHistogram2 = new ActiveTraceHistogram(31, 41, 11, 51);
activeTraceBo2.setActiveTraceHistogram(activeTraceHistogram2);
AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
statBuilder2.addActiveTrace(activeTraceBo2);
return builder.build();
}
Aggregations