From 82f3b02f602b8244047ab12f38dadc42f416bd2d Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 7 Oct 2010 08:09:07 -0500 Subject: Factor check completion pct into mirror score Use it as the divisor in our slightly longer equation. Signed-off-by: Dan McGee --- mirrors/utils.py | 9 +++++++-- templates/mirrors/status.html | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mirrors/utils.py b/mirrors/utils.py index e6d6c1dd..c64d53c5 100644 --- a/mirrors/utils.py +++ b/mirrors/utils.py @@ -57,11 +57,16 @@ def get_mirror_statuses(cutoff=default_cutoff): d = sum(url_delays, datetime.timedelta()) / len(url_delays) url.delay = d hours = d.days * 24.0 + d.seconds / 3600.0 - url.score = hours + url.duration_avg + url.duration_stddev + + if url.completion_pct > 0: + divisor = url.completion_pct + else: + # arbitrary small value + divisor = 0.005 + url.score = (hours + url.duration_avg + url.duration_stddev) / divisor else: url.delay = None url.score = None - url.completion = 0.0 return { 'cutoff': cutoff, diff --git a/templates/mirrors/status.html b/templates/mirrors/status.html index d2e45375..47ba9b7c 100644 --- a/templates/mirrors/status.html +++ b/templates/mirrors/status.html @@ -36,8 +36,9 @@

Mirror Status

retrieval time. A high standard deviation can indicate an unstable or overloaded mirror.
  • Mirror Score: A very rough calculation for ranking - mirrors. It is currently calculated as hours delay + average - duration + standard deviation. Lower is better.
  • + mirrors. It is currently calculated as (hours delay + average + duration + standard deviation) / completion percentage. Lower + is better.

    The final table on this page is an error log, which shows any errors that occurred while contacting mirrors. This only shows errors that -- cgit v1.2.3-54-g00ecf