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
|
// fallback
|
||||||
}
|
}
|
||||||
|
if (Constants.WINDOWS) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (getSystemLoadAverage == null) {
|
if (getSystemLoadAverage == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,11 +55,7 @@ public class OsProbeTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
if (Constants.WINDOWS) {
|
if (Constants.WINDOWS) {
|
||||||
// load average is unavailable on Windows
|
// load average is unavailable on Windows
|
||||||
if (loadAverage != null) {
|
assertNull(loadAverage);
|
||||||
assertThat(loadAverage[0], equalTo((double) -1));
|
|
||||||
assertThat(loadAverage[1], equalTo((double) -1));
|
|
||||||
assertThat(loadAverage[2], equalTo((double) -1));
|
|
||||||
}
|
|
||||||
} else if (Constants.LINUX) {
|
} else if (Constants.LINUX) {
|
||||||
// we should be able to get the load average
|
// we should be able to get the load average
|
||||||
assertNotNull(loadAverage);
|
assertNotNull(loadAverage);
|
||||||
|
|
Loading…
Reference in New Issue