Package com.djrapitops.plan.gathering
Class SystemUsage
java.lang.Object
com.djrapitops.plan.gathering.SystemUsage
Utility class for obtaining System usage statistics.
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
Check how active the system is (CPU) or if not available, using system load average.static long
Check how much disk space is available on the current partition.static long
Check how much memory (in Mb) is in use.
-
Method Details
-
getUsedMemory
public static long getUsedMemory()Check how much memory (in Mb) is in use.- Returns:
- used memory (megabytes) at the time of fetching
-
getAverageSystemLoad
public static double getAverageSystemLoad()Check how active the system is (CPU) or if not available, using system load average.- On some OSes CPU usage information is not available, and system load average is used instead. - On some OSes system load average is not available.
- Returns:
- 0.0 to 100.0 if CPU, or system load average, or -1 if nothing is available.
-
getFreeDiskSpace
public static long getFreeDiskSpace()Check how much disk space is available on the current partition.- Returns:
- free disk space (megabytes) on the partition JVM working directory is in.
- Throws:
SecurityException
- if permission is required to see disk space.
-