public class OsProbe
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
protected boolean |
areCgroupStatsAvailable()
Checks if cgroup stats are available by checking for the existence of
/proc/self/cgroup , /sys/fs/cgroup/cpu , and
/sys/fs/cgroup/cpuacct . |
long |
getFreePhysicalMemorySize()
Returns the amount of free physical memory in bytes.
|
long |
getFreeSwapSpaceSize()
Returns the amount of free swap space in bytes.
|
static OsProbe |
getInstance() |
short |
getSystemCpuPercent() |
long |
getTotalPhysicalMemorySize()
Returns the total amount of physical memory in bytes.
|
long |
getTotalSwapSpaceSize()
Returns the total amount of swap space in bytes.
|
OsInfo |
osInfo(long refreshInterval,
int allocatedProcessors) |
OsStats |
osStats() |
public long getFreePhysicalMemorySize()
public long getTotalPhysicalMemorySize()
public long getFreeSwapSpaceSize()
public long getTotalSwapSpaceSize()
public short getSystemCpuPercent()
protected boolean areCgroupStatsAvailable()
/proc/self/cgroup
, /sys/fs/cgroup/cpu
, and
/sys/fs/cgroup/cpuacct
.true
if the stats are available, otherwise false
public static OsProbe getInstance()
public OsInfo osInfo(long refreshInterval, int allocatedProcessors)
public OsStats osStats()