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();
}
Aggregations