diff options
author | Josh Blum | 2013-03-26 03:51:45 -0500 |
---|---|---|
committer | Josh Blum | 2013-03-26 03:51:45 -0500 |
commit | 66d14812e6deaedf151cdb619797f00b057a28c0 (patch) | |
tree | 3f8009612305ed7a7fa590cbcdfa5e99e9245e75 /python/gras/query/chart_total_io_counts.js | |
parent | 4b17a974da7adf42d30f0658e63955bfe3f161a2 (diff) | |
download | sandhi-66d14812e6deaedf151cdb619797f00b057a28c0.tar.gz sandhi-66d14812e6deaedf151cdb619797f00b057a28c0.tar.bz2 sandhi-66d14812e6deaedf151cdb619797f00b057a28c0.zip |
gras: use json for performance
Diffstat (limited to 'python/gras/query/chart_total_io_counts.js')
-rw-r--r-- | python/gras/query/chart_total_io_counts.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/python/gras/query/chart_total_io_counts.js b/python/gras/query/chart_total_io_counts.js index 5aaaf24..2f9ced3 100644 --- a/python/gras/query/chart_total_io_counts.js +++ b/python/gras/query/chart_total_io_counts.js @@ -16,15 +16,15 @@ function GrasChartTotalIoCounts(args) GrasChartTotalIoCounts.prototype.update = function(point) { - var block_data = $('block[id="' + this.block_id + '"]', point); + var block_data = point.blocks[this.block_id]; var ul = $('<ul />'); $('ul', this.div).remove(); //clear old lists this.div.append(ul); { - var init_time = parseInt($('init_time', block_data).text()); - var stats_time = parseInt($('stats_time', block_data).text()); - var tps = parseInt($('tps', block_data).text()); + 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' + ': '); @@ -48,9 +48,8 @@ GrasChartTotalIoCounts.prototype.update = function(point) var dir = contents[0]; var units = contents[1]; var key = contents[2]; - $(key, block_data).each(function(index, elem) + $.each(block_data[key], function(index, count) { - var count = parseInt($(elem).text()); var li = $('<li />'); var strong = $('<strong />').text(dir + index.toString() + ': '); var span = $('<span />').text(count.toString() + ' ' + units); |