Permalink
Browse files

Added queues to the root page.

  • Loading branch information...
1 parent 3d7c9da commit efa2745b211caeaca4255f77c88e804f75d96186 @dustin dustin committed May 25, 2012
Showing with 18 additions and 3 deletions.
  1. +18 −3 root.html
View
@@ -5,8 +5,12 @@
<script type="text/javascript" src="/static/d3.v2.min.js"></script>
<script type="text/javascript" src="/static/vbmap.js"></script>
<style type="text/css">
-#replicas, #cluster {
- float: left;
+
+#center {
+ text-align: center;
+}
+#replicas, #cluster, #queue {
+ display: inline;
font: 10px sans-serif;
}
@@ -39,6 +43,7 @@
<div id="loading">Loading...</div>
<div id="cluster"></div>
<div id="replicas"></div>
+ <div id="queue"></div>
</div>
<div>
<form id="clusterform" method="GET" action="/" style="display: none">
@@ -54,23 +59,33 @@
$("#clusterid").val(clusterInfo.cluster);
$("#bucketid").val(clusterInfo.bucket || 'default');
- var imgdim = Math.round((window.innerWidth / 2) - 20);
+ var imgdim = Math.min(
+ Math.round((window.innerWidth / 2) - 20),
+ Math.round(window.innerHeight - 260));
var state = makeState(imgdim, imgdim, '#cluster');
var chord = makeChord(imgdim, imgdim, '#replicas').fill('grey');
+ var queues = makeVBStatThing(imgdim * 2, 240, '#queue');
function updateGraphs(json) {
state(json);
chord(json);
$("#loading").hide();
}
+ function updateQueue(json) {
+ queues(json, 'queue_size');
+ }
+
doMapRequest(clusterInfo, updateGraphs, function() {
$("#loading").text("Problems initializing data, will keep retrying...");
}, function() { $("#clusterform").show(); });
+ doVBStatRequest(clusterInfo, updateQueue);
+
setInterval(function() {
doMapRequest(clusterInfo, updateGraphs);
+ doVBStatRequest(clusterInfo, updateQueue);
}, 5000);
});
</script>

0 comments on commit efa2745

Please sign in to comment.