Search in sources :

Example 1 with SystemMonitor

use of com.tvd12.ezyhttp.server.management.monitor.SystemMonitor in project ezyhttp by youngmonkeys.

the class MetricsController method cpuUsageGet.

@EzyFeature(DEFAULT_FEATURE_NAME)
@DoGet("/management/cpu-usage")
public CpuPoint cpuUsageGet() {
    SystemMonitor monitor = SystemMonitor.getInstance();
    EzyGcMonitor gcMonitor = monitor.getGcMonitor();
    EzyCpuMonitor cpuMonitor = monitor.getCpuMonitor();
    return CpuPoint.builder().systemCpuLoad(cpuMonitor.getSystemCpuLoad()).processCpuLoad(cpuMonitor.getProcessCpuLoad()).processGcActivity(gcMonitor.getProcessGcActivity()).build();
}
Also used : SystemMonitor(com.tvd12.ezyhttp.server.management.monitor.SystemMonitor) EzyGcMonitor(com.tvd12.ezyfox.monitor.EzyGcMonitor) EzyCpuMonitor(com.tvd12.ezyfox.monitor.EzyCpuMonitor) EzyFeature(com.tvd12.ezyfox.annotation.EzyFeature) DoGet(com.tvd12.ezyhttp.server.core.annotation.DoGet)

Aggregations

EzyFeature (com.tvd12.ezyfox.annotation.EzyFeature)1 EzyCpuMonitor (com.tvd12.ezyfox.monitor.EzyCpuMonitor)1 EzyGcMonitor (com.tvd12.ezyfox.monitor.EzyGcMonitor)1 DoGet (com.tvd12.ezyhttp.server.core.annotation.DoGet)1 SystemMonitor (com.tvd12.ezyhttp.server.management.monitor.SystemMonitor)1