Warning: session_start(): open(/var/lib/php/sessions/sess_ifcotn6qb7i0o6akljuhj4j7c1, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
cmodule EstimateDiskDoom > DynPrintLogAndEnabled {
switchable long timeHorizon = daysToMS(3); // don't report of longer than that away
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;
long ms = or0(estimator.doomDate)-sysNow();
if (estimator.doomDate == null || ms >= timeHorizon) ret with setStatus("Hard disk is doom-free!");
double days = toDays(ms), hours = toHours(ms);
S doomText = days >= 2
? iround(days) + " days from now"
: hours >= 2 ?
iround(hours) + " hours from now"
: n2(iround(toMinutes(ms)), "minute") + "from now";
// formatDouble(100-estimator.minValue, 0)
setStatus("DOOM IN " + doomText + " (hard disk " +
formatDouble(100-estimator.value1, 1) + "% full)");
}
void setStatus(S s) {
setModuleName(print(s));
}
}