Search in sources :

Example 6 with ActiveTraceHistogram

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));
}
Also used : TFActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram) TFActiveTrace(com.navercorp.pinpoint.thrift.dto.flink.TFActiveTrace) ActiveTraceHistogram(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram) TFActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram) ActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo) Test(org.junit.Test)

Example 7 with ActiveTraceHistogram

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();
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) ActiveTraceHistogram(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram) TFActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram) ActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)

Aggregations

ActiveTraceHistogram (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram)7 ActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)5 TActiveTraceHistogram (com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram)2 TFActiveTraceHistogram (com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram)2 AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)1 BaseHistogramSchema (com.navercorp.pinpoint.common.trace.BaseHistogramSchema)1 HistogramSchema (com.navercorp.pinpoint.common.trace.HistogramSchema)1 PActiveTraceHistogram (com.navercorp.pinpoint.grpc.trace.PActiveTraceHistogram)1 TFActiveTrace (com.navercorp.pinpoint.thrift.dto.flink.TFActiveTrace)1 Point (com.navercorp.pinpoint.web.vo.chart.Point)1 SampledActiveTrace (com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace)1 AgentStatPoint (com.navercorp.pinpoint.web.vo.stat.chart.agent.AgentStatPoint)1 TitledAgentStatPoint (com.navercorp.pinpoint.web.vo.stat.chart.agent.TitledAgentStatPoint)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1