Search in sources :

Example 6 with AgentStatCpuLoadBo

use of com.navercorp.pinpoint.common.server.bo.AgentStatCpuLoadBo in project pinpoint by naver.

the class LegacyAgentStatMapper method readSerializedBos.

// FIXME (2015.10) Legacy column for storing serialzied Bos separately.
@Deprecated
private List<AgentStat> readSerializedBos(String agentId, long timestamp, Map<byte[], byte[]> qualifierMap) {
    AgentStat agentStat = new AgentStat(agentId, timestamp);
    if (qualifierMap.containsKey(AGENT_STAT_CF_STATISTICS_MEMORY_GC)) {
        AgentStatMemoryGcBo.Builder builder = new AgentStatMemoryGcBo.Builder(qualifierMap.get(AGENT_STAT_CF_STATISTICS_MEMORY_GC));
        AgentStatMemoryGcBo agentStatMemoryGcBo = builder.build();
        agentStat.setGcType(agentStatMemoryGcBo.getGcType());
        agentStat.setGcOldCount(agentStatMemoryGcBo.getJvmGcOldCount());
        agentStat.setGcOldTime(agentStatMemoryGcBo.getJvmGcOldTime());
        agentStat.setHeapUsed(agentStatMemoryGcBo.getJvmMemoryHeapUsed());
        agentStat.setHeapMax(agentStatMemoryGcBo.getJvmMemoryHeapMax());
        agentStat.setNonHeapUsed(agentStatMemoryGcBo.getJvmMemoryNonHeapUsed());
        agentStat.setNonHeapMax(agentStatMemoryGcBo.getJvmMemoryNonHeapMax());
    }
    if (qualifierMap.containsKey(AGENT_STAT_CF_STATISTICS_CPU_LOAD)) {
        AgentStatCpuLoadBo.Builder builder = new AgentStatCpuLoadBo.Builder(qualifierMap.get(AGENT_STAT_CF_STATISTICS_CPU_LOAD));
        AgentStatCpuLoadBo agentStatCpuLoadBo = builder.build();
        agentStat.setJvmCpuUsage(agentStatCpuLoadBo.getJvmCpuLoad());
        agentStat.setSystemCpuUsage(agentStatCpuLoadBo.getSystemCpuLoad());
    }
    List<AgentStat> result = new ArrayList<>(1);
    result.add(agentStat);
    return result;
}
Also used : AgentStat(com.navercorp.pinpoint.web.vo.AgentStat) TAgentStat(com.navercorp.pinpoint.thrift.dto.TAgentStat) ArrayList(java.util.ArrayList) AgentStatMemoryGcBo(com.navercorp.pinpoint.common.server.bo.AgentStatMemoryGcBo) AgentStatCpuLoadBo(com.navercorp.pinpoint.common.server.bo.AgentStatCpuLoadBo)

Aggregations

AgentStatCpuLoadBo (com.navercorp.pinpoint.common.server.bo.AgentStatCpuLoadBo)6 Test (org.junit.Test)4 AgentStatMemoryGcBo (com.navercorp.pinpoint.common.server.bo.AgentStatMemoryGcBo)2 TAgentStat (com.navercorp.pinpoint.thrift.dto.TAgentStat)1 AgentStat (com.navercorp.pinpoint.web.vo.AgentStat)1 ArrayList (java.util.ArrayList)1 Cell (org.apache.hadoop.hbase.Cell)1