Merge pull request #15934 from jasontedor/freebsd-load-average
Add load averages to OS stats on FreeBSD Closes #15917
This commit is contained in:
commit
d5e20fb763
|
@ -111,8 +111,9 @@ public class OsProbe {
|
|||
* Returns the system load averages
|
||||
*/
|
||||
public double[] getSystemLoadAverage() {
|
||||
if (Constants.LINUX) {
|
||||
double[] loadAverage = readProcLoadavg("/proc/loadavg");
|
||||
if (Constants.LINUX || Constants.FREE_BSD) {
|
||||
final String procLoadAvg = Constants.LINUX ? "/proc/loadavg" : "/compat/linux/proc/loadavg";
|
||||
double[] loadAverage = readProcLoadavg(procLoadAvg);
|
||||
if (loadAverage != null) {
|
||||
return loadAverage;
|
||||
}
|
||||
|
|
|
@ -118,4 +118,7 @@ grant {
|
|||
|
||||
// load averages on Linux
|
||||
permission java.io.FilePermission "/proc/loadavg", "read";
|
||||
|
||||
// load averages on FreeBSD
|
||||
permission java.io.FilePermission "/compat/linux/proc/loadavg", "read";
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue