Package org.apache.hadoop.util
Class SysInfo
java.lang.Object
org.apache.hadoop.util.SysInfo
Plugin to calculate resource information on the system.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract longObtain the total size of the available physical memory present in the system.abstract longObtain the total size of the available virtual memory present in the system.abstract longObtain the CPU frequency of on the system.abstract floatObtain the CPU usage % of the machine.abstract longObtain the cumulative CPU time since the system is on.abstract longObtain the aggregated number of bytes read over the network.abstract longObtain the aggregated number of bytes written to the network.abstract intObtain total number of physical cores present on the system.abstract intObtain the total number of logical processors present on the system.abstract floatObtain the number of VCores used.abstract longObtain the total size of the physical memory present in the system.abstract longObtain the aggregated number of bytes read from disks.abstract longObtain the aggregated number of bytes written to disks.abstract longObtain the total size of the virtual memory present in the system.static SysInfoReturn default OS instance.
-
Constructor Details
-
SysInfo
public SysInfo()
-
-
Method Details
-
newInstance
Return default OS instance.- Returns:
- Default instance for the detected OS.
- Throws:
UnsupportedOperationException- If cannot determine OS.
-
getVirtualMemorySize
public abstract long getVirtualMemorySize()Obtain the total size of the virtual memory present in the system.- Returns:
- virtual memory size in bytes.
-
getPhysicalMemorySize
public abstract long getPhysicalMemorySize()Obtain the total size of the physical memory present in the system.- Returns:
- physical memory size bytes.
-
getAvailableVirtualMemorySize
public abstract long getAvailableVirtualMemorySize()Obtain the total size of the available virtual memory present in the system.- Returns:
- available virtual memory size in bytes.
-
getAvailablePhysicalMemorySize
public abstract long getAvailablePhysicalMemorySize()Obtain the total size of the available physical memory present in the system.- Returns:
- available physical memory size bytes.
-
getNumProcessors
public abstract int getNumProcessors()Obtain the total number of logical processors present on the system.- Returns:
- number of logical processors
-
getNumCores
public abstract int getNumCores()Obtain total number of physical cores present on the system.- Returns:
- number of physical cores
-
getCpuFrequency
public abstract long getCpuFrequency()Obtain the CPU frequency of on the system.- Returns:
- CPU frequency in kHz
-
getCumulativeCpuTime
public abstract long getCumulativeCpuTime()Obtain the cumulative CPU time since the system is on.- Returns:
- cumulative CPU time in milliseconds
-
getCpuUsagePercentage
public abstract float getCpuUsagePercentage()Obtain the CPU usage % of the machine. Return -1 if it is unavailable- Returns:
- CPU usage as a percentage (from 0 to 100) of available cycles.
-
getNumVCoresUsed
public abstract float getNumVCoresUsed()Obtain the number of VCores used. Return -1 if it is unavailable- Returns:
- Number of VCores used a percentage (from 0 to #VCores).
-
getNetworkBytesRead
public abstract long getNetworkBytesRead()Obtain the aggregated number of bytes read over the network.- Returns:
- total number of bytes read.
-
getNetworkBytesWritten
public abstract long getNetworkBytesWritten()Obtain the aggregated number of bytes written to the network.- Returns:
- total number of bytes written.
-
getStorageBytesRead
public abstract long getStorageBytesRead()Obtain the aggregated number of bytes read from disks.- Returns:
- total number of bytes read.
-
getStorageBytesWritten
public abstract long getStorageBytesWritten()Obtain the aggregated number of bytes written to disks.- Returns:
- total number of bytes written.
-