Search in sources :

Example 1 with TResponseTime

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

the class ThriftResponseTimeBoMapperTest method create.

@Override
protected TResponseTime create() {
    TResponseTime responseTime = new TResponseTime();
    long randomAvg = getRandomLong(0, MAX_AVG);
    responseTime.setAvg(randomAvg);
    long randomAdditionalMax = getRandomLong(0, 100);
    responseTime.setMax(randomAvg + randomAdditionalMax);
    return responseTime;
}
Also used : TResponseTime(com.navercorp.pinpoint.thrift.dto.TResponseTime)

Example 2 with TResponseTime

use of com.navercorp.pinpoint.thrift.dto.TResponseTime 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

TResponseTime (com.navercorp.pinpoint.thrift.dto.TResponseTime)2 ActiveTraceHistogram (com.navercorp.pinpoint.profiler.context.active.ActiveTraceHistogram)1 JvmGcMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.JvmGcMetricSnapshot)1 BufferMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.buffer.BufferMetricSnapshot)1 CpuLoadMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.cpu.CpuLoadMetricSnapshot)1 DataSourceMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSourceMetricSnapshot)1 DeadlockMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.deadlock.DeadlockMetricSnapshot)1 FileDescriptorMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.filedescriptor.FileDescriptorMetricSnapshot)1 LoadedClassMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.loadedclass.LoadedClassMetricSnapshot)1 ResponseTimeValue (com.navercorp.pinpoint.profiler.monitor.metric.response.ResponseTimeValue)1 TotalThreadMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.totalthread.TotalThreadMetricSnapshot)1 TransactionMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.transaction.TransactionMetricSnapshot)1 TActiveTrace (com.navercorp.pinpoint.thrift.dto.TActiveTrace)1 TActiveTraceHistogram (com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram)1 TAgentStat (com.navercorp.pinpoint.thrift.dto.TAgentStat)1 TCpuLoad (com.navercorp.pinpoint.thrift.dto.TCpuLoad)1 TDataSourceList (com.navercorp.pinpoint.thrift.dto.TDataSourceList)1 TDeadlock (com.navercorp.pinpoint.thrift.dto.TDeadlock)1 TDirectBuffer (com.navercorp.pinpoint.thrift.dto.TDirectBuffer)1 TFileDescriptor (com.navercorp.pinpoint.thrift.dto.TFileDescriptor)1