use of com.tvd12.ezyfox.annotation.EzyFeature in project ezyhttp by youngmonkeys.
the class MetricsController method threadsGet.
@EzyFeature(DEFAULT_FEATURE_NAME)
@DoGet("/management/thread-count")
public ThreadCountPoint threadsGet() {
EzyThreadsMonitor threadsMonitor = SystemMonitor.getInstance().getThreadsMonitor();
int threadCount = threadsMonitor.getThreadCount();
int daemonThreadCount = threadsMonitor.getDaemonThreadCount();
return ThreadCountPoint.builder().threadCount(threadCount).daemonThreadCount(daemonThreadCount).build();
}
use of com.tvd12.ezyfox.annotation.EzyFeature 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