Search in sources :

Example 1 with TJvmGc

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

the class JvmGcCommonMetricCollector method collect.

@Override
public TJvmGc collect() {
    TJvmGc jvmGc = new TJvmGc();
    jvmGc.setJvmMemoryHeapMax(memoryMetric.heapMax());
    jvmGc.setJvmMemoryHeapUsed(memoryMetric.heapUsed());
    jvmGc.setJvmMemoryNonHeapMax(memoryMetric.nonHeapMax());
    jvmGc.setJvmMemoryNonHeapUsed(memoryMetric.nonHeapUsed());
    jvmGc.setJvmGcOldCount(garbageCollectorMetric.gcOldCount());
    jvmGc.setJvmGcOldTime(garbageCollectorMetric.gcOldTime());
    jvmGc.setType(garbageCollectorMetric.gcType());
    return jvmGc;
}
Also used : TJvmGc(com.navercorp.pinpoint.thrift.dto.TJvmGc)

Example 2 with TJvmGc

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

the class LegacyAgentStatMapperTest method createResultForLegacyWith_AGENT_STAT_CF_STATISTICS_V1.

private Result createResultForLegacyWith_AGENT_STAT_CF_STATISTICS_V1() throws TException {
    final TAgentStat agentStat = new TAgentStat();
    final TJvmGc gc = new TJvmGc();
    gc.setType(GC_TYPE);
    gc.setJvmGcOldCount(GC_OLD_COUNT);
    gc.setJvmGcOldTime(GC_OLD_TIME);
    gc.setJvmMemoryHeapUsed(HEAP_USED);
    gc.setJvmMemoryHeapMax(HEAP_MAX);
    gc.setJvmMemoryNonHeapUsed(NON_HEAP_USED);
    gc.setJvmMemoryNonHeapMax(NON_HEAP_MAX);
    agentStat.setGc(gc);
    final TProtocolFactory factory = new TCompactProtocol.Factory();
    final TSerializer serializer = new TSerializer(factory);
    final byte[] qualifier = AGENT_STAT_CF_STATISTICS_V1;
    final byte[] value = serializer.serialize(agentStat);
    return Result.create(Arrays.asList(createCell(qualifier, value)));
}
Also used : TProtocolFactory(org.apache.thrift.protocol.TProtocolFactory) TSerializer(org.apache.thrift.TSerializer) TAgentStat(com.navercorp.pinpoint.thrift.dto.TAgentStat) TJvmGc(com.navercorp.pinpoint.thrift.dto.TJvmGc) TProtocolFactory(org.apache.thrift.protocol.TProtocolFactory)

Example 3 with TJvmGc

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

the class LegacyAgentStatMapper method readAgentStatThriftDto.

// FIXME (2014.08) Legacy support for TAgentStat Thrift DTO stored directly into hbase.
@Deprecated
private List<AgentStat> readAgentStatThriftDto(String agentId, long timestamp, byte[] tAgentStatByteArray) throws TException {
    // CompactProtocol used
    TDeserializer deserializer = new TDeserializer(factory);
    TAgentStat tAgentStat = new TAgentStat();
    deserializer.deserialize(tAgentStat, tAgentStatByteArray);
    TJvmGc gc = tAgentStat.getGc();
    if (gc == null) {
        return Collections.emptyList();
    }
    AgentStatMemoryGcBo.Builder memoryGcBoBuilder = new AgentStatMemoryGcBo.Builder(tAgentStat.getAgentId(), tAgentStat.getStartTimestamp(), tAgentStat.getTimestamp());
    memoryGcBoBuilder.gcType(gc.getType().name());
    memoryGcBoBuilder.jvmMemoryHeapUsed(gc.getJvmMemoryHeapUsed());
    memoryGcBoBuilder.jvmMemoryHeapMax(gc.getJvmMemoryHeapMax());
    memoryGcBoBuilder.jvmMemoryNonHeapUsed(gc.getJvmMemoryNonHeapUsed());
    memoryGcBoBuilder.jvmMemoryNonHeapMax(gc.getJvmMemoryNonHeapMax());
    memoryGcBoBuilder.jvmGcOldCount(gc.getJvmGcOldCount());
    memoryGcBoBuilder.jvmGcOldTime(gc.getJvmGcOldTime());
    AgentStat agentStat = new AgentStat(agentId, timestamp);
    AgentStatMemoryGcBo agentStatMemoryGcBo = memoryGcBoBuilder.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());
    List<AgentStat> result = new ArrayList<>(1);
    result.add(agentStat);
    return result;
}
Also used : TDeserializer(org.apache.thrift.TDeserializer) TAgentStat(com.navercorp.pinpoint.thrift.dto.TAgentStat) AgentStat(com.navercorp.pinpoint.web.vo.AgentStat) TAgentStat(com.navercorp.pinpoint.thrift.dto.TAgentStat) TJvmGc(com.navercorp.pinpoint.thrift.dto.TJvmGc) ArrayList(java.util.ArrayList) AgentStatMemoryGcBo(com.navercorp.pinpoint.common.server.bo.AgentStatMemoryGcBo)

Example 4 with TJvmGc

use of com.navercorp.pinpoint.thrift.dto.TJvmGc 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;
}
Also used : TActiveTrace(com.navercorp.pinpoint.thrift.dto.TActiveTrace) ActiveTraceHistogramBo(com.navercorp.pinpoint.common.server.bo.ActiveTraceHistogramBo) TJvmGc(com.navercorp.pinpoint.thrift.dto.TJvmGc) TCpuLoad(com.navercorp.pinpoint.thrift.dto.TCpuLoad) Put(org.apache.hadoop.hbase.client.Put) TTransaction(com.navercorp.pinpoint.thrift.dto.TTransaction)

Example 5 with TJvmGc

use of com.navercorp.pinpoint.thrift.dto.TJvmGc 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;
}
Also used : TAgentStat(com.navercorp.pinpoint.thrift.dto.TAgentStat) TDataSourceList(com.navercorp.pinpoint.thrift.dto.TDataSourceList) TJvmGc(com.navercorp.pinpoint.thrift.dto.TJvmGc) TCpuLoad(com.navercorp.pinpoint.thrift.dto.TCpuLoad)

Aggregations

TJvmGc (com.navercorp.pinpoint.thrift.dto.TJvmGc)6 TAgentStat (com.navercorp.pinpoint.thrift.dto.TAgentStat)3 TCpuLoad (com.navercorp.pinpoint.thrift.dto.TCpuLoad)2 ActiveTraceHistogramBo (com.navercorp.pinpoint.common.server.bo.ActiveTraceHistogramBo)1 AgentStatMemoryGcBo (com.navercorp.pinpoint.common.server.bo.AgentStatMemoryGcBo)1 TActiveTrace (com.navercorp.pinpoint.thrift.dto.TActiveTrace)1 TDataSourceList (com.navercorp.pinpoint.thrift.dto.TDataSourceList)1 TJvmGcDetailed (com.navercorp.pinpoint.thrift.dto.TJvmGcDetailed)1 TTransaction (com.navercorp.pinpoint.thrift.dto.TTransaction)1 AgentStat (com.navercorp.pinpoint.web.vo.AgentStat)1 ArrayList (java.util.ArrayList)1 Put (org.apache.hadoop.hbase.client.Put)1 TDeserializer (org.apache.thrift.TDeserializer)1 TSerializer (org.apache.thrift.TSerializer)1 TProtocolFactory (org.apache.thrift.protocol.TProtocolFactory)1