Search in sources :

Example 6 with TFActiveTrace

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

the class JoinActiveTraceBoMapper method map.

@Override
public JoinActiveTraceBo map(TFAgentStat tFAgentStat) {
    if (!tFAgentStat.isSetActiveTrace()) {
        return JoinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO;
    }
    final TFActiveTrace tFactiveTrace = tFAgentStat.getActiveTrace();
    final String agentId = tFAgentStat.getAgentId();
    if (tFactiveTrace.isSetHistogram() == false) {
        return JoinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO;
    }
    final TFActiveTraceHistogram histogram = tFactiveTrace.getHistogram();
    final int totalCount = calculateTotalCount(tFactiveTrace.getHistogram());
    JoinActiveTraceBo joinActiveTraceBo = new JoinActiveTraceBo();
    joinActiveTraceBo.setId(agentId);
    joinActiveTraceBo.setTimestamp(tFAgentStat.getTimestamp());
    joinActiveTraceBo.setHistogramSchemaType(histogram.getHistogramSchemaType());
    joinActiveTraceBo.setVersion(histogram.getVersion());
    joinActiveTraceBo.setTotalCountJoinValue(new JoinIntFieldBo(totalCount, totalCount, agentId, totalCount, agentId));
    return joinActiveTraceBo;
}
Also used : JoinIntFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinIntFieldBo) TFActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram) JoinActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo) TFActiveTrace(com.navercorp.pinpoint.thrift.dto.flink.TFActiveTrace)

Aggregations

TFActiveTrace (com.navercorp.pinpoint.thrift.dto.flink.TFActiveTrace)6 TFActiveTraceHistogram (com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram)6 Test (org.junit.Test)4 JoinActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo)3 JoinIntFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinIntFieldBo)3 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)3 ArrayList (java.util.ArrayList)2 ActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)1 ActiveTraceHistogram (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram)1 AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)1 JoinAgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo)1 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)1