|
@@ -384,6 +384,9 @@ get_stability(or_history_t *hist, time_t when)
|
|
|
return total / total_weights;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+#define MIN_WEIGHTED_TIME_TO_BE_UP (18*60*60)
|
|
|
+
|
|
|
|
|
|
* history <b>hist</b>. */
|
|
|
static double
|
|
@@ -399,6 +402,8 @@ get_weighted_fractional_uptime(or_history_t *hist, time_t when)
|
|
|
} else if (hist->start_of_downtime) {
|
|
|
total += (when - hist->start_of_downtime);
|
|
|
}
|
|
|
+ if (total < MIN_WEIGHTED_TIME_TO_BE_UP)
|
|
|
+ return 0.0;
|
|
|
return ((double) up) / total;
|
|
|
}
|
|
|
|