Skip to content
Snippets Groups Projects
Commit b47aa4c6 authored by Brian Moe's avatar Brian Moe
Browse files

Added uptime reporting.

parent 72fe3428
No related branches found
No related tags found
No related merge requests found
......@@ -7,10 +7,12 @@ from django.conf import settings
import os
def histo(request):
# Latency table.
try:
table = open(settings.LATENCY_REPORT_WEB_PAGE_FILE_PATH, "r").read()
except IOError:
table = "No Data Available"
table = None
# IFAR tables.
......@@ -22,10 +24,18 @@ def histo(request):
if os.access(fname, os.R_OK):
ifar.append(name)
# Uptime table.
try:
uptime = open(settings.UPTIME_REPORT_DIR + "/ytd.html", "r").read()
except IOError:
uptime = None
return render_to_response(
'gracedb/histogram.html',
{'table': table,
'ifar' : ifar,
'uptime' : uptime,
},
context_instance=RequestContext(request))
......@@ -60,6 +60,8 @@ LATENCY_REPORT_DEST_DIR = "/home/gracedb/data/latency"
LATENCY_MAXIMUM_CHARTED = 1800
LATENCY_REPORT_WEB_PAGE_FILE_PATH = LATENCY_REPORT_DEST_DIR + "/latency.inc"
# Uptime reporting
UPTIME_REPORT_DIR = "/home/gracedb/data/uptime"
# Find another way to do this.
......
......@@ -29,6 +29,11 @@ SKYALERT_IVORN_PATTERN = "ivo://ligo.org/gracedb#%s-dev"
# Latency histograms. Where they go and max latency to bin.
LATENCY_REPORT_DEST_DIR = "/home/bmoe/data/latency"
LATENCY_REPORT_WEB_PAGE_FILE_PATH = LATENCY_REPORT_DEST_DIR + "/latency.inc"
# Uptime reporting
UPTIME_REPORT_DIR = "/home/bmoe/data/uptime"
SITE_ID = 4
......
......@@ -4,14 +4,39 @@
{% block heading %}Reports{% endblock %}
{% block pageid %}reports{% endblock %}
{% block jscript %}
<script type="text/javascript">
function toggle(id) {
var div = document.getElementById(id);
if ( div.style.display == "block" ) {
div.style.display = "none";
}
else {
div.style.display = "block";
}
}
</script>
{% endblock %}
{% block content %}
<br/>
<a name="latency"></a><h3>Latency</h3>
{{ table|safe }}
<a name="latency" href="javascript:toggle('latency');"><h3>Latency</h3></a>
<div id="latency" style="display:none;">
{% if table %}
{{ table|safe }}
{% else %}
No Latency data.
{% endif %}
</div>
<br/>
<br/>
<a name="ifar"></a><h3>CBC IFAR</h3>
<a name="ifar" href="javascript:toggle('ifar');"><h3>CBC IFAR</h3></a>
<div id="ifar" style="display:none;">
{% if ifar %}
{% for chart in ifar %}
<img src="{{ chart }}"><br/>
......@@ -19,5 +44,21 @@
{% else %}
No IFAR charts.
{% endif %}
</div>
<br/>
<br/>
<a name="uptime" href="javascript:toggle('uptime');"><h3>Gracedb Uptime</h3></a>
<div id="uptime" style="display: none;">
{% if uptime %}
{{ uptime|safe }}
{% else %}
No uptime charts.
{% endif %}
</div>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment