Search in sources :

Example 1 with TActiveTraceHistogram

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

the class ThriftActiveTraceBoMapperTest method create.

@Override
protected TActiveTrace create() {
    TActiveTraceHistogram activeTraceHistogram = new TActiveTraceHistogram();
    if (getRandomBoolean()) {
        activeTraceHistogram.setVersion((short) 1);
    } else {
        activeTraceHistogram.setVersion((short) 2);
    }
    if (getRandomBoolean()) {
        activeTraceHistogram.setHistogramSchemaType(BaseHistogramSchema.NORMAL_SCHEMA.getTypeCode());
    } else {
        activeTraceHistogram.setHistogramSchemaType(BaseHistogramSchema.FAST_SCHEMA.getTypeCode());
    }
    activeTraceHistogram.setActiveTraceCount(Arrays.asList(getRandomInteger(0, Integer.MAX_VALUE), getRandomInteger(0, Integer.MAX_VALUE), getRandomInteger(0, Integer.MAX_VALUE), getRandomInteger(0, Integer.MAX_VALUE)));
    TActiveTrace activeTrace = new TActiveTrace();
    activeTrace.setHistogram(activeTraceHistogram);
    return activeTrace;
}
Also used : TActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram) TActiveTrace(com.navercorp.pinpoint.thrift.dto.TActiveTrace)

Example 2 with TActiveTraceHistogram

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

the class StatThriftMessageConverter method convertActiveTrace.

private TActiveTrace convertActiveTrace(ActiveTraceHistogram activeTraceHistogramMetricSnapshot) {
    final TActiveTrace activeTrace = new TActiveTrace();
    final TActiveTraceHistogram activeTraceHistogram = new TActiveTraceHistogram();
    if (activeTraceHistogramMetricSnapshot.getHistogramSchema() != null) {
        activeTraceHistogram.setHistogramSchemaType(activeTraceHistogramMetricSnapshot.getHistogramSchema().getTypeCode());
    }
    final List<Integer> activeTraceCounts = ActiveTraceHistogramUtils.asList(activeTraceHistogramMetricSnapshot);
    activeTraceHistogram.setActiveTraceCount(activeTraceCounts);
    activeTrace.setHistogram(activeTraceHistogram);
    return activeTrace;
}
Also used : TActiveTrace(com.navercorp.pinpoint.thrift.dto.TActiveTrace) TActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram)

Example 3 with TActiveTraceHistogram

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

the class ActiveTraceBoMapper method map.

@Override
public ActiveTraceBo map(TActiveTrace tActiveTrace) {
    TActiveTraceHistogram tActiveTraceHistogram = tActiveTrace.getHistogram();
    Map<SlotType, Integer> activeTraceCounts = createActiveTraceCountMap(tActiveTraceHistogram.getActiveTraceCount());
    ActiveTraceBo activeTraceBo = new ActiveTraceBo();
    activeTraceBo.setVersion(tActiveTraceHistogram.getVersion());
    activeTraceBo.setHistogramSchemaType(tActiveTraceHistogram.getHistogramSchemaType());
    activeTraceBo.setActiveTraceCounts(activeTraceCounts);
    return activeTraceBo;
}
Also used : TActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram) SlotType(com.navercorp.pinpoint.common.trace.SlotType) ActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)

Example 4 with TActiveTraceHistogram

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

the class ThriftActiveTraceBoMapper method map.

@Override
public ActiveTraceBo map(TActiveTrace tActiveTrace) {
    TActiveTraceHistogram tActiveTraceHistogram = tActiveTrace.getHistogram();
    ActiveTraceHistogram activeTraceHistogram = createActiveTraceCountMap(tActiveTraceHistogram.getActiveTraceCount());
    ActiveTraceBo activeTraceBo = new ActiveTraceBo();
    activeTraceBo.setVersion(tActiveTraceHistogram.getVersion());
    activeTraceBo.setHistogramSchemaType(tActiveTraceHistogram.getHistogramSchemaType());
    activeTraceBo.setActiveTraceHistogram(activeTraceHistogram);
    return activeTraceBo;
}
Also used : TActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram) ActiveTraceHistogram(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram) TActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram) ActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)

Aggregations

TActiveTraceHistogram (com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram)4 ActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)2 TActiveTrace (com.navercorp.pinpoint.thrift.dto.TActiveTrace)2 ActiveTraceHistogram (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram)1 SlotType (com.navercorp.pinpoint.common.trace.SlotType)1