Package oshi.util.platform.linux
Class ProcUtil
java.lang.Object
oshi.util.platform.linux.ProcUtil
public class ProcUtil
extends java.lang.Object
Provides access to some /proc filesystem info on Linux
-
Field Summary
-
Method Summary
Modifier and Type Method Description static java.io.File[]getPidFiles()Gets an array of files in the /proc directory with only numeric digit filenames, corresponding to processesstatic java.lang.StringgetProcPath()The proc filesystem location may be customized to allow alternative proc plugins, particularly useful for containers.static doublegetSystemUptimeSeconds()Parses the first value in /proc/uptime for seconds since bootstatic long[]readSystemCpuLoadTicks()Gets the CPU ticks array from /proc/stat
-
Field Details
-
CPUINFO
public static final java.lang.String CPUINFOThe proc path for CPU information- See Also:
- Constant Field Values
-
STAT
public static final java.lang.String STATThe proc path for CPU statistics- See Also:
- Constant Field Values
-
-
Method Details
-
getProcPath
public static java.lang.String getProcPath()The proc filesystem location may be customized to allow alternative proc plugins, particularly useful for containers.- Returns:
- The proc filesystem path, with a leading / but not a trailing one, e.g., "/proc"
-
getSystemUptimeSeconds
public static double getSystemUptimeSeconds()Parses the first value in /proc/uptime for seconds since boot- Returns:
- Seconds since boot
-
readSystemCpuLoadTicks
public static long[] readSystemCpuLoadTicks()Gets the CPU ticks array from /proc/stat- Returns:
- Array of CPU ticks
-
getPidFiles
public static java.io.File[] getPidFiles()Gets an array of files in the /proc directory with only numeric digit filenames, corresponding to processes- Returns:
- An array of File objects for the process files
-