Package com.github.jpmsilva.jsystemd
Class CpuStatusProvider
java.lang.Object
com.github.jpmsilva.jsystemd.CpuStatusProvider
- All Implemented Interfaces:
StatusProvider
Implementation of
StatusProvider that provides the CPU usage, such as CPU: 12.5% process; 40.1% system; load 1.20: the share of
the available processors the process used since the status was last read, or since this provider was created, the recent CPU usage of the whole system,
and the system load average over the last minute.
Unlike the CPU time shown by systemctl status, which adds up all the time since the service started, this shows how busy the process is now.
The available processors are those the JVM can use, which take into account the CPU quota of the service unit, set by systemd with CPUQuota.
What the operating system does not provide is left out, such as the load average, which is not available on Windows.
- Author:
- Joao Silva
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new CpuStatusProvider, which reports the CPU usage of the process since it was created on the first read. -
Method Summary
-
Constructor Details
-
CpuStatusProvider
public CpuStatusProvider()Create a new CpuStatusProvider, which reports the CPU usage of the process since it was created on the first read.
-
-
Method Details
-
status
Description copied from interface:StatusProviderExposes status information to send to systemd.- Specified by:
statusin interfaceStatusProvider- Returns:
- the string message to add to the service status
-