summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mirrors/views.py9
-rw-r--r--templates/mirrors/status.html56
-rw-r--r--templates/mirrors/status_table.html2
3 files changed, 60 insertions, 7 deletions
diff --git a/mirrors/views.py b/mirrors/views.py
index a31c1371..59d6337b 100644
--- a/mirrors/views.py
+++ b/mirrors/views.py
@@ -69,12 +69,16 @@ def status(request):
last_check=Max('logs__check_time'),
duration_avg=Avg('logs__duration'), duration_min=Min('logs__duration'),
duration_max=Max('logs__duration'), duration_stddev=StdDev('logs__duration')
- ).order_by('mirror__country', 'url')
+ ).order_by('-last_sync', '-duration_avg')
# errors during check process go in another table
error_logs = MirrorLog.objects.filter(
is_success=False, check_time__gte=cutoff_time).values(
'url__url', 'url__protocol__protocol', 'url__mirror__country',
- 'error').annotate(Count('error'), Max('check_time'))
+ 'error').annotate(
+ error_count=Count('error'), last_occurred=Max('check_time')
+ ).order_by('-last_occurred', '-error_count')
+
+ last_check = max([u.last_check for u in urls])
good_urls = []
bad_urls = []
@@ -93,6 +97,7 @@ def status(request):
good_urls.append(url)
context = {
+ 'last_check': last_check,
'good_urls': good_urls,
'bad_urls': bad_urls,
'error_logs': error_logs,
diff --git a/templates/mirrors/status.html b/templates/mirrors/status.html
index 8dd6fa11..5743e47b 100644
--- a/templates/mirrors/status.html
+++ b/templates/mirrors/status.html
@@ -5,19 +5,64 @@
{% block content %}
<div id="mirrorstatus" class="box">
<h2>Mirror Status</h2>
+ <p>This page reports the status of all known, public, and active Arch Linux
+ mirrors. All data on this page reflects the status of the mirrors within
+ the <em>last 24 hours</em>. All listed times are UTC. The check script runs
+ on a regular basis and polls for the <tt>lastsync</tt> file in the root of
+ our repository layout. This file is regularly updated on the central
+ repository, so checking the value within allows one to see if the mirror
+ has synced recently. This page contains several pieces of information about
+ each mirror.</p>
+ <ul>
+ <li><em>Mirror URL:</em> Mirrors are checked on a per-URL basis. If
+ both FTP and HTTP access are provided, both will be listed here.</li>
+ <li><em>Last Sync:</em> The timestamp retrieved from the
+ <tt>lastsync</tt> file on the mirror. If this file could not be
+ retrieved or contained data we didn't recognize, this column will show
+ 'unknown'.</li>
+ <li><em>Delay:</em> The calculated mirroring delay; e.g. <code>last
+ check − last sync</code>.</li>
+ <li><em>μ Duration:</em> The average (mean) time it took to connect and
+ retrieve the <tt>lastsync</tt> file from the given URL. Note that this
+ connection time is from the location of the Arch server; your geography
+ may product different results.</li>
+ <li><em>σ Duration:</em> The standard deviation of the connect and
+ retrieval time. A high standard deviation can indicate an unstable or
+ overloaded mirror.</li>
+ <li><em>Mirror Score:</em> A very rough calculation for ranking
+ mirrors. It is currently calculated as <code>hours delay + average
+ duration + standard deviation</code>. Lower is better.</li>
+ </ul>
+ <p>The final table on this page is an error log, which shows any errors
+ that occurred while contacting mirrors. This only shows errors that
+ occurred within the last 24 hours.</p>
+ <ul>
+ <li><a href="#outofsync">Out of Sync Mirrors</a></li>
+ <li><a href="#successful">Successfully Syncing Mirrors</a></li>
+ <li><a href="#errorlog">Mirror Syncing Error Log</a></li>
+ </ul>
+ <p>The last mirror check ran at {{ last_check|date:'Y-m-d H:i' }} UTC.</p>
+
+ <a name="outofsync"/>
<h3>Out of Sync Mirrors</h3>
{% with bad_urls as urls %}
+ {% with 'outofsync_mirrors' as table_id %}
{% include "mirrors/status_table.html" %}
{% endwith %}
+ {% endwith %}
+ <a name="successful"/>
<h3>Successfully Syncing Mirrors</h3>
{% with good_urls as urls %}
+ {% with 'successful_mirrors' as table_id %}
{% include "mirrors/status_table.html" %}
{% endwith %}
+ {% endwith %}
+ <a name="errorlog"/>
<h3>Mirror Syncing Error Log</h3>
- <table class="results">
+ <table id="errorlog_mirrors" class="results">
<thead>
<tr>
<th>Mirror URL</th>
@@ -35,8 +80,8 @@
<td>{{ log.url__protocol__protocol }}</td>
<td>{{ log.url__mirror__country }}</td>
<td>{{ log.error }}</td>
- <td>{{ log.check_time__max|date:'Y-m-d H:i' }}</td>
- <td>{{ log.error__count }}</td>
+ <td>{{ log.last_occurred|date:'Y-m-d H:i' }}</td>
+ <td>{{ log.error_count }}</td>
</tr>
{% endfor %}
</tbody>
@@ -47,7 +92,10 @@
<script type="text/javascript" src="/media/jquery.tablesorter.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
- $(".results").tablesorter({widgets: ['zebra']});
+ $("#outofsync_mirrors").add("#successful_mirrors").tablesorter(
+ {widgets: ['zebra'], sortList: [[3,1], [5,1]]});
+ $("#errorlog_mirrors").tablesorter(
+ {widgets: ['zebra'], sortList: [[4,1], [5,1]]});
});
</script>
{% endblock %}
diff --git a/templates/mirrors/status_table.html b/templates/mirrors/status_table.html
index d7f5b0ec..90bbf6b6 100644
--- a/templates/mirrors/status_table.html
+++ b/templates/mirrors/status_table.html
@@ -1,5 +1,5 @@
{% load mirror_status %}
-<table class="results">
+<table id="{{ table_id }}" class="results">
<thead>
<tr>
<th>Mirror URL</th>