public class OSSystemInfo<INFO> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
OSSystemInfo.Basic
Basic OS and JVM information class.
|
static class |
OSSystemInfo.Details
Detailed information class.
|
static class |
OSSystemInfo.HistoryEntry<INFO>
The history entry information.
|
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_INTERVAL
The default history gatherer interval: 30 seconds.
|
Constructor and Description |
---|
OSSystemInfo(IAdditonalInformation<INFO> informationProvider)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
static int |
getAvailableProcessors()
Gets the number of processors available to the Java virtual machine.
|
static OSSystemInfo.Basic |
getBasic()
Gets the basic information.
|
static OSSystemInfo.Details |
getDetails()
Gets detailed information of the OS and process memory/swap space usage and CPU load.
|
OSSystemInfo.HistoryEntry<INFO>[] |
getHistory(long start)
Gets the history entries gathered between a date up to the last available entry.
|
long |
getHistoryInterval()
Gets the interval used for gathering of history entries.
|
static double |
getSystemLoadAverage()
Gets the average load during the last minute.
|
boolean |
isGatheringHistory()
Checks if history is being gathered.
|
void |
setMaxHistorySize(int maxSize)
Sets the maximum number of entries in the history.
|
boolean |
startHistory(long interval)
Starts the history gatherer.
|
boolean |
stopHistory()
Stops the history gatherer.
|
public static final long DEFAULT_INTERVAL
public OSSystemInfo(IAdditonalInformation<INFO> informationProvider)
informationProvider
- The additional information provider to be stored with the history data, or null for none.public static OSSystemInfo.Basic getBasic()
If a security manager prohibits access to the OS information, a warning message is logged in the console.
public static double getSystemLoadAverage()
public static int getAvailableProcessors()
public static OSSystemInfo.Details getDetails()
public boolean startHistory(long interval)
interval
- In milliseconds.public void setMaxHistorySize(int maxSize)
maxSize
- The maximum size, between 100 and 100_000.IllegalArgumentException
- If range is invalid.public long getHistoryInterval()
public boolean isGatheringHistory()
public boolean stopHistory()
public OSSystemInfo.HistoryEntry<INFO>[] getHistory(long start)
start
- The start time for the events in milliseconds since the Epoch, or zero for all history entries.iizi® is a registered trademark of Mindus SARL. © Copyright 2019 Mindus SARL. All rights reserved.