Search in sources :

Example 1 with ActiveTraceHistogram

use of com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram in project pinpoint by naver.

the class GrpcActiveThreadCountService method getActiveThreadCountResponse.

private PCmdActiveThreadCountRes.Builder getActiveThreadCountResponse() {
    final long currentTime = System.currentTimeMillis();
    final ActiveTraceHistogram histogram = activeTraceRepository.getActiveTraceHistogram(currentTime);
    PCmdActiveThreadCountRes.Builder responseBuilder = PCmdActiveThreadCountRes.newBuilder();
    responseBuilder.setTimeStamp(currentTime);
    responseBuilder.setHistogramSchemaType(histogram.getHistogramSchema().getTypeCode());
    final List<Integer> activeTraceCountList = ActiveTraceHistogramUtils.asList(histogram);
    for (Integer activeTraceCount : activeTraceCountList) {
        responseBuilder.addActiveThreadCount(activeTraceCount);
    }
    return responseBuilder;
}
Also used : PCmdActiveThreadCountRes(com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadCountRes) ActiveTraceHistogram(com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram)

Example 2 with ActiveTraceHistogram

use of com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram in project pinpoint by naver.

the class GrpcStatMessageConverter method converAgentStat.

private PAgentStat converAgentStat(final AgentStatMetricSnapshot agentStatMetricSnapshot) {
    final PAgentStat.Builder agentStatBuilder = PAgentStat.newBuilder();
    agentStatBuilder.setTimestamp(agentStatMetricSnapshot.getTimestamp());
    agentStatBuilder.setCollectInterval(agentStatMetricSnapshot.getCollectInterval());
    // Skip agent information(agentId, startTimestamp)
    // Metric
    final JvmGcMetricSnapshot jvmGcMetricSnapshot = agentStatMetricSnapshot.getGc();
    if (jvmGcMetricSnapshot != null) {
        final PJvmGc jvmGc = convertJvmGc(jvmGcMetricSnapshot);
        agentStatBuilder.setGc(jvmGc);
    }
    final CpuLoadMetricSnapshot cpuLoadMetricSnapshot = agentStatMetricSnapshot.getCpuLoad();
    if (cpuLoadMetricSnapshot != null) {
        final PCpuLoad cpuLoad = convertCpuLoad(cpuLoadMetricSnapshot);
        agentStatBuilder.setCpuLoad(cpuLoad);
    }
    final TransactionMetricSnapshot transactionMetricSnapshot = agentStatMetricSnapshot.getTransaction();
    if (transactionMetricSnapshot != null) {
        final PTransaction transaction = convertTransaction(transactionMetricSnapshot);
        agentStatBuilder.setTransaction(transaction);
    }
    final ActiveTraceHistogram activeTraceHistogram = agentStatMetricSnapshot.getActiveTrace();
    if (activeTraceHistogram != null) {
        final PActiveTrace activeTrace = convertActiveTrace(activeTraceHistogram);
        agentStatBuilder.setActiveTrace(activeTrace);
    }
    final DataSourceMetricSnapshot dataSourceMetricSnapshot = agentStatMetricSnapshot.getDataSourceList();
    if (dataSourceMetricSnapshot != null) {
        final PDataSourceList dataSourceList = convertDataSourceList(dataSourceMetricSnapshot);
        agentStatBuilder.setDataSourceList(dataSourceList);
    }
    final ResponseTimeValue responseTimeValue = agentStatMetricSnapshot.getResponseTime();
    if (responseTimeValue != null) {
        final PResponseTime responseTime = convertResponseTime(responseTimeValue);
        agentStatBuilder.setResponseTime(responseTime);
    }
    final DeadlockMetricSnapshot deadlockMetricSnapshot = agentStatMetricSnapshot.getDeadlock();
    if (deadlockMetricSnapshot != null) {
        final PDeadlock deadlock = convertDeadlock(deadlockMetricSnapshot);
        agentStatBuilder.setDeadlock(deadlock);
    }
    final FileDescriptorMetricSnapshot fileDescriptorMetricSnapshot = agentStatMetricSnapshot.getFileDescriptor();
    if (fileDescriptorMetricSnapshot != null) {
        final PFileDescriptor fileDescriptor = convertFileDescriptor(fileDescriptorMetricSnapshot);
        agentStatBuilder.setFileDescriptor(fileDescriptor);
    }
    final BufferMetricSnapshot bufferMetricSnapshot = agentStatMetricSnapshot.getDirectBuffer();
    if (bufferMetricSnapshot != null) {
        final PDirectBuffer directBuffer = convertDirectBuffer(bufferMetricSnapshot);
        agentStatBuilder.setDirectBuffer(directBuffer);
    }
    final TotalThreadMetricSnapshot totalThreadMetricSnapshot = agentStatMetricSnapshot.getTotalThread();
    if (totalThreadMetricSnapshot != null) {
        final PTotalThread totalThread = convertTotalThread(totalThreadMetricSnapshot);
        agentStatBuilder.setTotalThread(totalThread);
    }
    final LoadedClassMetricSnapshot loadedClassMetricSnapshot = agentStatMetricSnapshot.getLoadedClassCount();
    if (loadedClassMetricSnapshot != null) {
        final PLoadedClass loadedClass = convertLoadedClass(loadedClassMetricSnapshot);
        agentStatBuilder.setLoadedClass(loadedClass);
    }
    return agentStatBuilder.build();
}
Also used : PJvmGc(com.navercorp.pinpoint.grpc.trace.PJvmGc) PTransaction(com.navercorp.pinpoint.grpc.trace.PTransaction) ResponseTimeValue(com.navercorp.pinpoint.profiler.monitor.metric.response.ResponseTimeValue) PLoadedClass(com.navercorp.pinpoint.grpc.trace.PLoadedClass) BufferMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.buffer.BufferMetricSnapshot) PDataSourceList(com.navercorp.pinpoint.grpc.trace.PDataSourceList) TotalThreadMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.totalthread.TotalThreadMetricSnapshot) PAgentStat(com.navercorp.pinpoint.grpc.trace.PAgentStat) PActiveTrace(com.navercorp.pinpoint.grpc.trace.PActiveTrace) FileDescriptorMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.filedescriptor.FileDescriptorMetricSnapshot) PActiveTraceHistogram(com.navercorp.pinpoint.grpc.trace.PActiveTraceHistogram) ActiveTraceHistogram(com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram) CpuLoadMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.cpu.CpuLoadMetricSnapshot) PCpuLoad(com.navercorp.pinpoint.grpc.trace.PCpuLoad) PFileDescriptor(com.navercorp.pinpoint.grpc.trace.PFileDescriptor) PDirectBuffer(com.navercorp.pinpoint.grpc.trace.PDirectBuffer) DataSourceMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSourceMetricSnapshot) JvmGcMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.JvmGcMetricSnapshot) PResponseTime(com.navercorp.pinpoint.grpc.trace.PResponseTime) DeadlockMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.deadlock.DeadlockMetricSnapshot) LoadedClassMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.loadedclass.LoadedClassMetricSnapshot) TransactionMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.transaction.TransactionMetricSnapshot) PDeadlock(com.navercorp.pinpoint.grpc.trace.PDeadlock) PTotalThread(com.navercorp.pinpoint.grpc.trace.PTotalThread)

Example 3 with ActiveTraceHistogram

use of com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram in project pinpoint by naver.

the class ActiveThreadCountService method getActiveThreadCountResponse.

private TCmdActiveThreadCountRes getActiveThreadCountResponse() {
    final long currentTime = System.currentTimeMillis();
    final ActiveTraceHistogram histogram = this.activeTraceRepository.getActiveTraceHistogram(currentTime);
    TCmdActiveThreadCountRes response = new TCmdActiveThreadCountRes();
    response.setHistogramSchemaType(histogram.getHistogramSchema().getTypeCode());
    final List<Integer> activeTraceCounts = ActiveTraceHistogramUtils.asList(histogram);
    response.setActiveThreadCount(activeTraceCounts);
    response.setTimeStamp(currentTime);
    return response;
}
Also used : TCmdActiveThreadCountRes(com.navercorp.pinpoint.thrift.dto.command.TCmdActiveThreadCountRes) ActiveTraceHistogram(com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram)

Example 4 with ActiveTraceHistogram

use of com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram in project pinpoint by naver.

the class DefaultActiveTraceMetric method activeTraceHistogram.

@Override
public ActiveTraceHistogram activeTraceHistogram() {
    final long currentTimeMillis = System.currentTimeMillis();
    final ActiveTraceHistogram histogram = activeTraceRepository.getActiveTraceHistogram(currentTimeMillis);
    return histogram;
}
Also used : ActiveTraceHistogram(com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram)

Example 5 with ActiveTraceHistogram

use of com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram in project pinpoint by naver.

the class StatThriftMessageConverter method convertAgentStat.

private TAgentStat convertAgentStat(final AgentStatMetricSnapshot agentStatMetricSnapshot) {
    final TAgentStat agentStat = new TAgentStat();
    agentStat.setTimestamp(agentStatMetricSnapshot.getTimestamp());
    agentStat.setCollectInterval(agentStatMetricSnapshot.getCollectInterval());
    // Agent information
    agentStat.setAgentId(agentStatMetricSnapshot.getAgentId());
    agentStat.setStartTimestamp(agentStatMetricSnapshot.getStartTimestamp());
    // Metric
    final JvmGcMetricSnapshot jvmGcMetricSnapshot = agentStatMetricSnapshot.getGc();
    if (jvmGcMetricSnapshot != null) {
        final TJvmGc jvmGc = convertJvmGc(jvmGcMetricSnapshot);
        agentStat.setGc(jvmGc);
    }
    final CpuLoadMetricSnapshot cpuLoadMetricSnapshot = agentStatMetricSnapshot.getCpuLoad();
    if (cpuLoadMetricSnapshot != null) {
        final TCpuLoad cpuLoad = convertCpuLoad(cpuLoadMetricSnapshot);
        agentStat.setCpuLoad(cpuLoad);
    }
    final TransactionMetricSnapshot transactionMetricSnapshot = agentStatMetricSnapshot.getTransaction();
    if (transactionMetricSnapshot != null) {
        final TTransaction transaction = convertTransaction(transactionMetricSnapshot);
        agentStat.setTransaction(transaction);
    }
    final ActiveTraceHistogram activeTraceHistogram = agentStatMetricSnapshot.getActiveTrace();
    if (activeTraceHistogram != null) {
        final TActiveTrace activeTrace = convertActiveTrace(activeTraceHistogram);
        agentStat.setActiveTrace(activeTrace);
    }
    final DataSourceMetricSnapshot dataSourceMetricSnapshot = agentStatMetricSnapshot.getDataSourceList();
    if (dataSourceMetricSnapshot != null) {
        final TDataSourceList dataSourceList = convertDataSourceList(dataSourceMetricSnapshot);
        agentStat.setDataSourceList(dataSourceList);
    }
    final ResponseTimeValue responseTimeValue = agentStatMetricSnapshot.getResponseTime();
    if (responseTimeValue != null) {
        final TResponseTime responseTime = convertResponseTime(responseTimeValue);
        agentStat.setResponseTime(responseTime);
    }
    final DeadlockMetricSnapshot deadlockMetricSnapshot = agentStatMetricSnapshot.getDeadlock();
    if (deadlockMetricSnapshot != null) {
        final TDeadlock deadlock = convertDeadlock(deadlockMetricSnapshot);
        agentStat.setDeadlock(deadlock);
    }
    final FileDescriptorMetricSnapshot fileDescriptorMetricSnapshot = agentStatMetricSnapshot.getFileDescriptor();
    if (fileDescriptorMetricSnapshot != null) {
        final TFileDescriptor fileDescriptor = convertFileDescriptor(fileDescriptorMetricSnapshot);
        agentStat.setFileDescriptor(fileDescriptor);
    }
    final BufferMetricSnapshot bufferMetricSnapshot = agentStatMetricSnapshot.getDirectBuffer();
    if (bufferMetricSnapshot != null) {
        final TDirectBuffer directBuffer = convertDirectBuffer(bufferMetricSnapshot);
        agentStat.setDirectBuffer(directBuffer);
    }
    final TotalThreadMetricSnapshot totalThreadMetricSnapshot = agentStatMetricSnapshot.getTotalThread();
    if (totalThreadMetricSnapshot != null) {
        final TTotalThreadCount totalThreadCount = convertTotalThreadCount(totalThreadMetricSnapshot);
        agentStat.setTotalThreadCount(totalThreadCount);
    }
    final LoadedClassMetricSnapshot loadedClassMetricSnapshot = agentStatMetricSnapshot.getLoadedClassCount();
    if (loadedClassMetricSnapshot != null) {
        final TLoadedClass loadedClass = convertLoadedClass(loadedClassMetricSnapshot);
        agentStat.setLoadedClass(loadedClass);
    }
    return agentStat;
}
Also used : ResponseTimeValue(com.navercorp.pinpoint.profiler.monitor.metric.response.ResponseTimeValue) TAgentStat(com.navercorp.pinpoint.thrift.dto.TAgentStat) BufferMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.buffer.BufferMetricSnapshot) TActiveTrace(com.navercorp.pinpoint.thrift.dto.TActiveTrace) TotalThreadMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.totalthread.TotalThreadMetricSnapshot) TJvmGc(com.navercorp.pinpoint.thrift.dto.TJvmGc) FileDescriptorMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.filedescriptor.FileDescriptorMetricSnapshot) TDirectBuffer(com.navercorp.pinpoint.thrift.dto.TDirectBuffer) ActiveTraceHistogram(com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram) TActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram) CpuLoadMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.cpu.CpuLoadMetricSnapshot) TCpuLoad(com.navercorp.pinpoint.thrift.dto.TCpuLoad) TResponseTime(com.navercorp.pinpoint.thrift.dto.TResponseTime) TDeadlock(com.navercorp.pinpoint.thrift.dto.TDeadlock) TDataSourceList(com.navercorp.pinpoint.thrift.dto.TDataSourceList) DataSourceMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSourceMetricSnapshot) JvmGcMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.JvmGcMetricSnapshot) TLoadedClass(com.navercorp.pinpoint.thrift.dto.TLoadedClass) DeadlockMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.deadlock.DeadlockMetricSnapshot) LoadedClassMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.loadedclass.LoadedClassMetricSnapshot) TFileDescriptor(com.navercorp.pinpoint.thrift.dto.TFileDescriptor) TTotalThreadCount(com.navercorp.pinpoint.thrift.dto.TTotalThreadCount) TransactionMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.transaction.TransactionMetricSnapshot) TTransaction(com.navercorp.pinpoint.thrift.dto.TTransaction)

Aggregations

ActiveTraceHistogram (com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram)5 JvmGcMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.JvmGcMetricSnapshot)2 BufferMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.buffer.BufferMetricSnapshot)2 CpuLoadMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.cpu.CpuLoadMetricSnapshot)2 DataSourceMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSourceMetricSnapshot)2 DeadlockMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.deadlock.DeadlockMetricSnapshot)2 FileDescriptorMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.filedescriptor.FileDescriptorMetricSnapshot)2 LoadedClassMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.loadedclass.LoadedClassMetricSnapshot)2 ResponseTimeValue (com.navercorp.pinpoint.profiler.monitor.metric.response.ResponseTimeValue)2 TotalThreadMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.totalthread.TotalThreadMetricSnapshot)2 TransactionMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.transaction.TransactionMetricSnapshot)2 PActiveTrace (com.navercorp.pinpoint.grpc.trace.PActiveTrace)1 PActiveTraceHistogram (com.navercorp.pinpoint.grpc.trace.PActiveTraceHistogram)1 PAgentStat (com.navercorp.pinpoint.grpc.trace.PAgentStat)1 PCmdActiveThreadCountRes (com.navercorp.pinpoint.grpc.trace.PCmdActiveThreadCountRes)1 PCpuLoad (com.navercorp.pinpoint.grpc.trace.PCpuLoad)1 PDataSourceList (com.navercorp.pinpoint.grpc.trace.PDataSourceList)1 PDeadlock (com.navercorp.pinpoint.grpc.trace.PDeadlock)1 PDirectBuffer (com.navercorp.pinpoint.grpc.trace.PDirectBuffer)1 PFileDescriptor (com.navercorp.pinpoint.grpc.trace.PFileDescriptor)1