summaryrefslogtreecommitdiff
path: root/src/viz
diff options
context:
space:
mode:
Diffstat (limited to 'src/viz')
-rw-r--r--src/viz/stats.html16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/viz/stats.html b/src/viz/stats.html
index f73c7a9..ca6c8b2 100644
--- a/src/viz/stats.html
+++ b/src/viz/stats.html
@@ -14,11 +14,24 @@
<tr><td>LastStartTime</td><td id="LastStartTime"></td></tr>
</table>
<script type="text/javascript">
+function pad(number) {
+ if ( number < 10 ) {
+ return '0' + number;
+ }
+ return number;
+}
+
+function toQueryIsoData(dateStr) {
+ ts = new Date(dateStr)
+ return ts.toISOString();
+}
+
function updateStats() {
var queryStr = "";
if ($("#LastStartTime").text() != "") {
- queryStr = "?from=" + $("#LastStartTime").text()
+ queryStr = "?from=" + toQueryIsoData($("#LastStartTime").text())
}
+
$.getJSON("/stats" + queryStr, function(data) {
$("#ClientCount").text(data.ClientCount);
$("#UpdateCount").text(data.UpdateCount);
@@ -27,6 +40,7 @@ function updateStats() {
$("#StartTime").text(data.StartTime);
$("#LastStartTime").text(data.LastStartTime);
});
+
setTimeout("updateStats()", 5000)
}