summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJosh Blum2013-03-29 02:57:07 -0500
committerJosh Blum2013-03-29 02:57:07 -0500
commitca6d6b4a7786ecc3754532d85ed39da33684d5fc (patch)
tree58617d955e28cc88bb28d081dd96c2033d238e58 /python
parent4d1cabf10e654faa3017225bc47763a1b80aab0f (diff)
downloadsandhi-ca6d6b4a7786ecc3754532d85ed39da33684d5fc.tar.gz
sandhi-ca6d6b4a7786ecc3754532d85ed39da33684d5fc.tar.bz2
sandhi-ca6d6b4a7786ecc3754532d85ed39da33684d5fc.zip
gras: added hooks to query instantaneous state
Diffstat (limited to 'python')
-rw-r--r--python/gras/query/chart_factory.js5
-rw-r--r--python/gras/query/chart_total_io_counts.js31
-rw-r--r--python/gras/query/main.js5
3 files changed, 24 insertions, 17 deletions
diff --git a/python/gras/query/chart_factory.js b/python/gras/query/chart_factory.js
index 20715a6..ae23728 100644
--- a/python/gras/query/chart_factory.js
+++ b/python/gras/query/chart_factory.js
@@ -1,4 +1,9 @@
/***********************************************************************
+ * Some constants
+ **********************************************************************/
+var GRAS_CHARTS_STD_WIDTH = 250;
+
+/***********************************************************************
* Chart registry for now chart types
**********************************************************************/
var gras_chart_get_registry = function()
diff --git a/python/gras/query/chart_total_io_counts.js b/python/gras/query/chart_total_io_counts.js
index 2f9ced3..f959414 100644
--- a/python/gras/query/chart_total_io_counts.js
+++ b/python/gras/query/chart_total_io_counts.js
@@ -21,20 +21,29 @@ GrasChartTotalIoCounts.prototype.update = function(point)
$('ul', this.div).remove(); //clear old lists
this.div.append(ul);
+ function make_entry(strong, span)
{
- var init_time = parseInt(block_data.init_time);
- var stats_time = parseInt(block_data.stats_time);
- var tps = parseInt(block_data.tps);
- var duration = (stats_time - init_time)/tps;
var li = $('<li />');
- var strong = $('<strong />').text('Elapsed' + ': ');
- var span = $('<span />').text(duration.toFixed(2).toString() + ' secs');
+ var strong = $('<strong />').text(strong + ": ");
+ var span = $('<span />').text(span);
li.append(strong);
li.append(span);
ul.append(li);
}
+ //create total time elapsed entry
+ {
+ var init_time = block_data.init_time;
+ var stats_time = block_data.stats_time;
+ var tps = block_data.tps;
+ var duration = (stats_time - init_time)/tps;
+ make_entry('Elapsed', duration.toFixed(2).toString() + ' secs');
+ }
+
var stuff = [
+ ['Enque', 'items', 'items_enqueued'],
+ ['Enque', 'tags', 'tags_enqueued'],
+ ['Enque', 'msgs', 'msgs_enqueued'],
['Input', 'items', 'items_consumed'],
['Input', 'tags', 'tags_consumed'],
['Input', 'msgs', 'msgs_consumed'],
@@ -50,12 +59,10 @@ GrasChartTotalIoCounts.prototype.update = function(point)
var key = contents[2];
$.each(block_data[key], function(index, count)
{
- var li = $('<li />');
- var strong = $('<strong />').text(dir + index.toString() + ': ');
- var span = $('<span />').text(count.toString() + ' ' + units);
- li.append(strong);
- li.append(span);
- if (count > 0) ul.append(li);
+ if (count > 0)
+ {
+ make_entry(dir + index.toString(), count.toString() + ' ' + units);
+ }
});
});
}
diff --git a/python/gras/query/main.js b/python/gras/query/main.js
index a12457e..a9c255b 100644
--- a/python/gras/query/main.js
+++ b/python/gras/query/main.js
@@ -1,9 +1,4 @@
/***********************************************************************
- * Some constants
- **********************************************************************/
-var GRAS_CHARTS_STD_WIDTH = 250;
-
-/***********************************************************************
* Stats registry data structure
**********************************************************************/
var GrasStatsRegistry = function()