!7 cmodule EstimateDiskDoom > DynPrintLogAndEnabled { transient new DoomEstimator estimator; start { estimator.minValue = 3.0; // 3 percent free space doEveryAndNow(60.0, r measure); } void measure enter { double value = 100-diskSpacePercentage_oshi(); printWithTime("Free space: " + formatDouble(value, 3) + " %"); if (!estimator.consumeValue(value)) ret; if (estimator.doomDate == null) ret with print("No doom!"); long ms = estimator.doomDate-sysNow(); double days = toDays(ms), hours = toHours(ms); print("Doom date (" + formatDouble(estimator.minValue, 0) + "%): " + ( days >= 2 ? iround(toDays(ms)) + " days from now" : hours >= 2 ? hours + " hours from now" : n2(iround(toMinutes(ms)), + "minute") + "from now")); } }