@Private @Evolving public class SysInfoLinux extends SysInfo
| Modifier and Type | Field | Description |
|---|---|---|
static long |
JIFFY_LENGTH_IN_MILLIS |
|
static long |
PAGE_SIZE |
| Constructor | Description |
|---|---|
SysInfoLinux() |
|
SysInfoLinux(java.lang.String procfsMemFile,
java.lang.String procfsCpuFile,
java.lang.String procfsStatFile,
java.lang.String procfsNetFile,
java.lang.String procfsDisksFile,
long jiffyLengthInMillis) |
Constructor which allows assigning the /proc/ directories.
|
| Modifier and Type | Method | Description |
|---|---|---|
long |
getAvailablePhysicalMemorySize() |
Obtain the total size of the available physical memory present
in the system.
|
long |
getAvailableVirtualMemorySize() |
Obtain the total size of the available virtual memory present
in the system.
|
long |
getCpuFrequency() |
Obtain the CPU frequency of on the system.
|
float |
getCpuUsagePercentage() |
Obtain the CPU usage % of the machine.
|
long |
getCumulativeCpuTime() |
Obtain the cumulative CPU time since the system is on.
|
long |
getJiffyLengthInMillis() |
|
long |
getNetworkBytesRead() |
Obtain the aggregated number of bytes read over the network.
|
long |
getNetworkBytesWritten() |
Obtain the aggregated number of bytes written to the network.
|
int |
getNumCores() |
Obtain total number of physical cores present on the system.
|
int |
getNumProcessors() |
Obtain the total number of logical processors present on the system.
|
float |
getNumVCoresUsed() |
Obtain the number of VCores used.
|
long |
getPhysicalMemorySize() |
Obtain the total size of the physical memory present in the system.
|
long |
getStorageBytesRead() |
Obtain the aggregated number of bytes read from disks.
|
long |
getStorageBytesWritten() |
Obtain the aggregated number of bytes written to disks.
|
long |
getVirtualMemorySize() |
Obtain the total size of the virtual memory present in the system.
|
static void |
main(java.lang.String[] args) |
Test the
SysInfoLinux. |
newInstancepublic static final long PAGE_SIZE
public static final long JIFFY_LENGTH_IN_MILLIS
public SysInfoLinux()
@VisibleForTesting
public SysInfoLinux(java.lang.String procfsMemFile,
java.lang.String procfsCpuFile,
java.lang.String procfsStatFile,
java.lang.String procfsNetFile,
java.lang.String procfsDisksFile,
long jiffyLengthInMillis)
procfsMemFile - fake file for /proc/meminfoprocfsCpuFile - fake file for /proc/cpuinfoprocfsStatFile - fake file for /proc/statprocfsNetFile - fake file for /proc/net/devprocfsDisksFile - fake file for /proc/diskstatsjiffyLengthInMillis - fake jiffy length valuepublic long getPhysicalMemorySize()
getPhysicalMemorySize in class SysInfopublic long getVirtualMemorySize()
getVirtualMemorySize in class SysInfopublic long getAvailablePhysicalMemorySize()
getAvailablePhysicalMemorySize in class SysInfopublic long getAvailableVirtualMemorySize()
getAvailableVirtualMemorySize in class SysInfopublic int getNumProcessors()
getNumProcessors in class SysInfopublic int getNumCores()
getNumCores in class SysInfopublic long getCpuFrequency()
getCpuFrequency in class SysInfopublic long getCumulativeCpuTime()
getCumulativeCpuTime in class SysInfopublic float getCpuUsagePercentage()
getCpuUsagePercentage in class SysInfopublic float getNumVCoresUsed()
getNumVCoresUsed in class SysInfopublic long getNetworkBytesRead()
getNetworkBytesRead in class SysInfopublic long getNetworkBytesWritten()
getNetworkBytesWritten in class SysInfopublic long getStorageBytesRead()
SysInfogetStorageBytesRead in class SysInfopublic long getStorageBytesWritten()
SysInfogetStorageBytesWritten in class SysInfopublic static void main(java.lang.String[] args)
SysInfoLinux.args - - arguments to this calculator testpublic long getJiffyLengthInMillis()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.