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:
Jason Tedor 2016-01-18 14:00:15 -05:00
parent d55952a90d
commit f5b72b0714
2 changed files with 4 additions and 5 deletions

View File

@ -119,6 +119,9 @@ public class OsProbe {
}
// fallback
}
if (Constants.WINDOWS) {
return null;
}
if (getSystemLoadAverage == null) {
return null;
}

View File

@ -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);