use of com.navercorp.pinpoint.profiler.monitor.metric.JvmGcMetricSnapshot in project pinpoint by naver.
the class BasicJvmGcMetricCollector method collect.
@Override
public JvmGcMetricSnapshot collect() {
final JvmGcType jvmGcType = garbageCollectorMetric.getGcType();
final MemoryMetricSnapshot memoryMetricSnapshot = memoryMetric.getSnapshot();
final GarbageCollectorMetricSnapshot garbageCollectorMetricSnapshot = garbageCollectorMetric.getSnapshot();
final JvmGcMetricSnapshot jvmGcMetricSnapshot = new JvmGcMetricSnapshot();
jvmGcMetricSnapshot.setJvmMemoryHeapMax(memoryMetricSnapshot.getHeapMax());
jvmGcMetricSnapshot.setJvmMemoryHeapUsed(memoryMetricSnapshot.getHeapUsed());
jvmGcMetricSnapshot.setJvmMemoryNonHeapMax(memoryMetricSnapshot.getNonHeapMax());
jvmGcMetricSnapshot.setJvmMemoryNonHeapUsed(memoryMetricSnapshot.getNonHeapUsed());
jvmGcMetricSnapshot.setJvmGcOldCount(garbageCollectorMetricSnapshot.getGcOldCount());
jvmGcMetricSnapshot.setJvmGcOldTime(garbageCollectorMetricSnapshot.getGcOldTime());
jvmGcMetricSnapshot.setType(jvmGcType);
return jvmGcMetricSnapshot;
}
use of com.navercorp.pinpoint.profiler.monitor.metric.JvmGcMetricSnapshot 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();
}
use of com.navercorp.pinpoint.profiler.monitor.metric.JvmGcMetricSnapshot in project pinpoint by naver.
the class DetailedJvmGcMetricCollector method collect.
@Override
public JvmGcMetricSnapshot collect() {
final JvmGcMetricSnapshot jvmGcMetricSnapshot = jvmGcMetricCollector.collect();
final DetailedMemoryMetricSnapshot detailedMemoryMetricSnapshot = detailedMemoryMetric.getSnapshot();
final DetailedGarbageCollectorMetricSnapshot detailedGarbageCollectorMetricSnapshot = detailedGarbageCollectorMetric.getSnapshot();
final JvmGcDetailedMetricSnapshot jvmGcDetailedMetricSnapshot = new JvmGcDetailedMetricSnapshot();
jvmGcDetailedMetricSnapshot.setJvmPoolNewGenUsed(detailedMemoryMetricSnapshot.getNewGenUsage());
jvmGcDetailedMetricSnapshot.setJvmPoolOldGenUsed(detailedMemoryMetricSnapshot.getOldGenUsage());
jvmGcDetailedMetricSnapshot.setJvmPoolSurvivorSpaceUsed(detailedMemoryMetricSnapshot.getSurvivorSpaceUsage());
jvmGcDetailedMetricSnapshot.setJvmPoolCodeCacheUsed(detailedMemoryMetricSnapshot.getCodeCacheUsage());
jvmGcDetailedMetricSnapshot.setJvmPoolPermGenUsed(detailedMemoryMetricSnapshot.getPermGenUsage());
jvmGcDetailedMetricSnapshot.setJvmPoolMetaspaceUsed(detailedMemoryMetricSnapshot.getMetaspaceUsage());
jvmGcDetailedMetricSnapshot.setJvmGcNewCount(detailedGarbageCollectorMetricSnapshot.getGcNewCount());
jvmGcDetailedMetricSnapshot.setJvmGcNewTime(detailedGarbageCollectorMetricSnapshot.getGcNewTime());
jvmGcMetricSnapshot.setJvmGcDetailed(jvmGcDetailedMetricSnapshot);
return jvmGcMetricSnapshot;
}
use of com.navercorp.pinpoint.profiler.monitor.metric.JvmGcMetricSnapshot 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;
}
Aggregations