public class SysInfoLinux extends Object
Modifier and Type | Field and Description |
---|---|
static long |
JIFFY_LENGTH_IN_MILLIS |
static long |
PAGE_SIZE |
Constructor and Description |
---|
SysInfoLinux() |
SysInfoLinux(String procfsMemFile,
String procfsCpuFile,
String procfsStatFile,
String procfsNetFile,
String procfsDisksFile,
long jiffyLengthInMillis)
Constructor which allows assigning the /proc/ directories.
|
Modifier and Type | Method and Description |
---|---|
void |
closeReader(Reader reader) |
long |
getAvailablePhysicalMemorySize() |
long |
getAvailableVirtualMemorySize() |
long |
getCpuFrequency() |
float |
getCpuUsagePercentage() |
long |
getCumulativeCpuTime() |
long |
getJiffyLengthInMillis() |
long |
getNetworkBytesRead() |
long |
getNetworkBytesWritten() |
int |
getNumCores() |
int |
getNumCpuSocket() |
int |
getNumProcessors() |
float |
getNumVCoresUsed() |
long |
getPhysicalMemorySize() |
long |
getStorageBytesRead() |
long |
getStorageBytesWritten() |
long |
getVirtualMemorySize() |
static void |
main(String[] args)
Test the
SysInfoLinux . |
public static final long PAGE_SIZE
public static final long JIFFY_LENGTH_IN_MILLIS
public SysInfoLinux()
public SysInfoLinux(String procfsMemFile, String procfsCpuFile, String procfsStatFile, String procfsNetFile, 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()
public long getVirtualMemorySize()
public long getAvailablePhysicalMemorySize()
public long getAvailableVirtualMemorySize()
public int getNumProcessors()
public int getNumCores()
public int getNumCpuSocket()
public long getCpuFrequency()
public long getCumulativeCpuTime()
public float getCpuUsagePercentage()
public float getNumVCoresUsed()
public long getNetworkBytesRead()
public long getNetworkBytesWritten()
public long getStorageBytesRead()
public long getStorageBytesWritten()
public void closeReader(Reader reader)
public static void main(String[] args)
SysInfoLinux
.args
- - arguments to this calculator testpublic long getJiffyLengthInMillis()
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.