diff options
author | Josh Blum | 2013-03-23 15:51:48 -0500 |
---|---|---|
committer | Josh Blum | 2013-03-23 15:51:48 -0500 |
commit | 73be1e48f9cc9229cb18750074d1798346acd0fd (patch) | |
tree | 64010c462340ec3f936348971e11e3756743cf61 /python/gras/stats/chart_overall_throughput.js | |
parent | 418aa7ea25386d7d735f60b6b4c2f75be19b7d1c (diff) | |
download | sandhi-73be1e48f9cc9229cb18750074d1798346acd0fd.tar.gz sandhi-73be1e48f9cc9229cb18750074d1798346acd0fd.tar.bz2 sandhi-73be1e48f9cc9229cb18750074d1798346acd0fd.zip |
gras: filled in the other chart types
Diffstat (limited to 'python/gras/stats/chart_overall_throughput.js')
-rw-r--r-- | python/gras/stats/chart_overall_throughput.js | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/python/gras/stats/chart_overall_throughput.js b/python/gras/stats/chart_overall_throughput.js index 04c532e..d9c6730 100644 --- a/python/gras/stats/chart_overall_throughput.js +++ b/python/gras/stats/chart_overall_throughput.js @@ -1,9 +1,42 @@ function GrasChartOverallThroughput(args) { - + //save enables + this.ids = args.block_ids; + + //input checking + if (this.ids.length <= 1) gras_error_dialog( + "GrasChartOverallThroughput", + "Error making overall thoughput chart.\n"+ + "Specify at least 2 blocks for this chart." + ); + + //make new chart + this.chart = new google.visualization.LineChart(args.panel); + + this.title = "Overall Throughput vs Time"; } GrasChartOverallThroughput.prototype.update = function(history) { - + if (history.length < 2) return; + + var data_set = [['Throughput'].concat(this.ids)]; + for (var i = Math.max(history.length-10, 1); i < history.length; i++) + { + var row = new Array(); + row.push(i.toString()); + for (var j = 0; j < this.ids.length; j++) + { + row.push(gras_extract_throughput_delta(history[i-1], history[i], this.ids[j])/1e6); + } + data_set.push(row); + } + + var chart_data = google.visualization.arrayToDataTable(data_set); + var options = { + width:$('#page').width()*0.33, + chartArea:{left:0,top:0,right:0,bottom:0,width:"100%",height:"85%"}, + legend: {'position': 'bottom'}, + }; + this.chart.draw(chart_data, options); }; |