use of com.navercorp.pinpoint.thrift.dto.TCpuLoad in project pinpoint by naver.
the class HbaseAgentStatDao method createPut.
private Put createPut(TAgentStat agentStat) {
long timestamp = agentStat.getTimestamp();
byte[] key = getDistributedRowKey(agentStat, timestamp);
Put put = new Put(key);
final long collectInterval = agentStat.getCollectInterval();
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_INTERVAL, Bytes.toBytes(collectInterval));
// GC, Memory
if (agentStat.isSetGc()) {
TJvmGc gc = agentStat.getGc();
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_GC_TYPE, Bytes.toBytes(gc.getType().name()));
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_GC_OLD_COUNT, Bytes.toBytes(gc.getJvmGcOldCount()));
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_GC_OLD_TIME, Bytes.toBytes(gc.getJvmGcOldTime()));
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_HEAP_USED, Bytes.toBytes(gc.getJvmMemoryHeapUsed()));
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_HEAP_MAX, Bytes.toBytes(gc.getJvmMemoryHeapMax()));
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_NON_HEAP_USED, Bytes.toBytes(gc.getJvmMemoryNonHeapUsed()));
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_NON_HEAP_MAX, Bytes.toBytes(gc.getJvmMemoryNonHeapMax()));
} else {
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_GC_TYPE, Bytes.toBytes(TJvmGcType.UNKNOWN.name()));
}
// CPU
if (agentStat.isSetCpuLoad()) {
TCpuLoad cpuLoad = agentStat.getCpuLoad();
double jvmCpuLoad = AgentStatUtils.convertLongToDouble(AgentStatUtils.convertDoubleToLong(cpuLoad.getJvmCpuLoad()));
double systemCpuLoad = AgentStatUtils.convertLongToDouble(AgentStatUtils.convertDoubleToLong(cpuLoad.getSystemCpuLoad()));
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_JVM_CPU, Bytes.toBytes(jvmCpuLoad));
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_SYS_CPU, Bytes.toBytes(systemCpuLoad));
}
// Transaction
if (agentStat.isSetTransaction()) {
TTransaction transaction = agentStat.getTransaction();
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_TRANSACTION_SAMPLED_NEW, Bytes.toBytes(transaction.getSampledNewCount()));
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_TRANSACTION_SAMPLED_CONTINUATION, Bytes.toBytes(transaction.getSampledContinuationCount()));
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_TRANSACTION_UNSAMPLED_NEW, Bytes.toBytes(transaction.getUnsampledNewCount()));
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_TRANSACTION_UNSAMPLED_CONTINUATION, Bytes.toBytes(transaction.getUnsampledContinuationCount()));
}
// Active Trace
if (agentStat.isSetActiveTrace()) {
TActiveTrace activeTrace = agentStat.getActiveTrace();
if (activeTrace.isSetHistogram()) {
ActiveTraceHistogramBo activeTraceHistogramBo = this.activeTraceHistogramBoMapper.map(activeTrace.getHistogram());
put.addColumn(AGENT_STAT_CF_STATISTICS, AGENT_STAT_COL_ACTIVE_TRACE_HISTOGRAM, activeTraceHistogramBo.writeValue());
}
}
return put;
}
use of com.navercorp.pinpoint.thrift.dto.TCpuLoad in project pinpoint by naver.
the class AgentStatHandlerV2Test method createAgentStat.
private TAgentStat createAgentStat(String agentId, long startTimestamp) {
final TAgentStat agentStat = new TAgentStat();
agentStat.setAgentId(agentId);
agentStat.setStartTimestamp(startTimestamp);
agentStat.setGc(new TJvmGc());
agentStat.setCpuLoad(new TCpuLoad());
agentStat.setDataSourceList(new TDataSourceList());
return agentStat;
}
use of com.navercorp.pinpoint.thrift.dto.TCpuLoad in project pinpoint by naver.
the class DefaultCpuLoadMetricCollector method collect.
@Override
public TCpuLoad collect() {
TCpuLoad cpuLoad = new TCpuLoad();
cpuLoad.setJvmCpuLoad(cpuLoadMetric.jvmCpuLoad());
cpuLoad.setSystemCpuLoad(cpuLoadMetric.systemCpuLoad());
return cpuLoad;
}
Aggregations