Load average on Windows is never available
Since load average is never available on Windows, this commit modifies the handling of load average there to just always return null.
This commit is contained in:
parent
d55952a90d
commit
f5b72b0714
|
@ -119,6 +119,9 @@ public class OsProbe {
|
|||
}
|
||||
// fallback
|
||||
}
|
||||
if (Constants.WINDOWS) {
|
||||
return null;
|
||||
}
|
||||
if (getSystemLoadAverage == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -55,11 +55,7 @@ public class OsProbeTests extends ESTestCase {
|
|||
}
|
||||
if (Constants.WINDOWS) {
|
||||
// load average is unavailable on Windows
|
||||
if (loadAverage != null) {
|
||||
assertThat(loadAverage[0], equalTo((double) -1));
|
||||
assertThat(loadAverage[1], equalTo((double) -1));
|
||||
assertThat(loadAverage[2], equalTo((double) -1));
|
||||
}
|
||||
assertNull(loadAverage);
|
||||
} else if (Constants.LINUX) {
|
||||
// we should be able to get the load average
|
||||
assertNotNull(loadAverage);
|
||||
|
|
Loading…
Reference in New Issue