summaryrefslogtreecommitdiff
path: root/src/viz/stats.html
diff options
context:
space:
mode:
authorMarkus Grüneis <gimpf@gimpf.org>2014-10-23 15:44:59 +0200
committerMarkus Grüneis <gimpf@gimpf.org>2014-10-23 16:23:31 +0200
commit0ae123214a552724f0ce557523bd59e7c4bb1695 (patch)
treed4ba5de5e6cd40ef0dec32b7fa102ff44433544e /src/viz/stats.html
parentupdated changelog for release (diff)
viz: Add basic tabular stats page.
Diffstat (limited to 'src/viz/stats.html')
-rw-r--r--src/viz/stats.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/viz/stats.html b/src/viz/stats.html
new file mode 100644
index 0000000..f73c7a9
--- /dev/null
+++ b/src/viz/stats.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<script type="text/javascript" src="/viz/jquery-2.1.1.min.js"></script>
+</head>
+<body>
+<table>
+<tr><td>ClientCount</td><td id="ClientCount"></td></tr>
+<tr><td>UpdateCount</td><td id="UpdateCount"></td></tr>
+<tr><td>BytesSent</td><td id="BytesSent"></td></tr>
+<tr><td>BytesReceived</td><td id="BytesReceived"></td></tr>
+<tr><td>StartTime</td><td id="StartTime"></td></tr>
+<tr><td>LastStartTime</td><td id="LastStartTime"></td></tr>
+</table>
+<script type="text/javascript">
+function updateStats() {
+ var queryStr = "";
+ if ($("#LastStartTime").text() != "") {
+ queryStr = "?from=" + $("#LastStartTime").text()
+ }
+ $.getJSON("/stats" + queryStr, function(data) {
+ $("#ClientCount").text(data.ClientCount);
+ $("#UpdateCount").text(data.UpdateCount);
+ $("#BytesSent").text(data.BytesSent);
+ $("#BytesReceived").text(data.BytesReceived);
+ $("#StartTime").text(data.StartTime);
+ $("#LastStartTime").text(data.LastStartTime);
+ });
+ setTimeout("updateStats()", 5000)
+}
+
+$(document).ready(function()
+ {
+ updateStats();
+ });
+</script>
+</body>
+</html>