Slide 23
Slide 23 text
provider.with("load.1min", Double.class)
.slidingWindow(LoadHealthHypothesis.WINDOW_LENGTH, MINUTES)
.mapWithContext((context, values) -> {
long cpuCount = cpuCount(context);
if (cpuCount > 0) {
return values.entrySet()
.stream()
.filter((entry) -> entry.getValue() > cpuCount * 2)
.count();
}
return 0L;
})
.filter(hypothesis.predicate())
.mapWithContext(hypothesis.health())
.toHealth("load");
Knowledge Implementation Example