From d2d266292c56ec3e4f87a503cba083e0f79376c7 Mon Sep 17 00:00:00 2001 From: saksham115 Date: Thu, 14 Sep 2017 21:55:38 +0530 Subject: Implementing the extension: Display of Steady State Convergence Report - All block sizes In addition, introducing an intermediary page for single json portal. JIRA: STORPERF-141 Change-Id: I6dd7f43b1f0fd8293c4872e6a7c3ef909f2ddb83 Signed-off-by: saksham115 --- docker/storperf-reporting/src/app.py | 2 +- .../src/templates/plot_multi_data.html | 76 ++++++++++++++- .../src/templates/plot_tables.html | 107 +++++++++++++++++++-- 3 files changed, 176 insertions(+), 9 deletions(-) (limited to 'docker') diff --git a/docker/storperf-reporting/src/app.py b/docker/storperf-reporting/src/app.py index 46318ca..38f1198 100644 --- a/docker/storperf-reporting/src/app.py +++ b/docker/storperf-reporting/src/app.py @@ -66,7 +66,7 @@ def success(): if response[0] == "single": metrics, report_data = response[1], response[2] results = response[3] - return render_template('plot_multi_data.html', + return render_template('plot_tables.html', metrics=metrics, report_data=report_data, results=results) else: diff --git a/docker/storperf-reporting/src/templates/plot_multi_data.html b/docker/storperf-reporting/src/templates/plot_multi_data.html index 4205fd6..a07e3d5 100644 --- a/docker/storperf-reporting/src/templates/plot_multi_data.html +++ b/docker/storperf-reporting/src/templates/plot_multi_data.html @@ -83,7 +83,6 @@ ul { results = {{ results | tojson | safe }}; function init(){ page = []; - report_data = results[0]["details"]["report_data"]; ids = []; text = "

"; for ( var i = 0; i < results.length ; i++ ){ @@ -119,6 +118,8 @@ ul { text += "

Criteria : " + results[i]["criteria"] + "

"; text += "

Build Tag : " + results[i]["build_tag"] + "

"; text += ""; + text += ""; + text += "
" text += ""; for (var i = 0; i < keys.length; i++ ){ text += "
"; @@ -268,6 +269,79 @@ ul { document.getElementById("report").innerHTML = table; } + function create_block_report(){ + var ele = document.getElementById("block_report"); + var text = ""; + text += "
    " + text += "
  • Read
  • "; + text += "
  • Bandwidth (KB/s)
  • "; + text += "
  • IOPS
  • "; + text += "
  • Latency (nanoseconds/ns)
  • "; + text += "
  • Write
  • "; + text += "
  • Bandwidth (KB/s)
  • "; + text += "
  • IOPS
  • "; + text += "
  • Latency (nanoseconds/ns)
  • "; + text += "
  • Close
  • "; + text += "
"; + ele.innerHTML = text; + } + function close_block_report(){ + document.getElementById("block_report").innerHTML = ""; + } + function create_block_graph(key,test){ + data = {}; + for(i in report_data){ + data[i] = report_data[i][test][key]; + } + var modal = document.getElementById('myModal'); + var modal_div = document.getElementById('modal-text'); + modal_div.innerHTML += "

"; + var name = ""; + var average = data["average"]; + if(test == "bw") + name = "Bandwidth (KB/s)"; + else if(test == "iops") + name = "IOPS"; + else + name = "Latency (nanoseconds/ns)"; + var plot_data = []; + for(i in data){ + var x = []; + var y = []; + var len = data[i]["series"].length; + for(var j = 0 ; j < len ; j++){ + x[j] = data[i]["series"][j][0]; + y[j] = data[i]["series"][j][1]; + } + var trace = { + x: x, + y: y, + type: 'scatter', + name: i + }; + plot_data.push(trace); + } + var layout = { + autosize: false, + xaxis: { + title: 'Round' + }, + yaxis: { + title: name + }, + margin: { + l: 0, + r: 0, + b: 0, + t: 0, + pad: 4 + }, + width: 500, + height: 500 + }; + Plotly.newPlot('graph',plot_data,layout); + modal.style.display = "block"; + } init(); document.getElementById("close").onclick = function(){ document.getElementById('modal-text').innerHTML = ""; diff --git a/docker/storperf-reporting/src/templates/plot_tables.html b/docker/storperf-reporting/src/templates/plot_tables.html index a0770bf..37af3f6 100644 --- a/docker/storperf-reporting/src/templates/plot_tables.html +++ b/docker/storperf-reporting/src/templates/plot_tables.html @@ -74,18 +74,43 @@ page = []; metrics = {{ metrics | tojson | safe }}; report_data = {{ report_data | tojson | safe }}; + results = {{ results | tojson | safe }}; + results = results[0]; keys = []; for (var k in report_data){ keys.push(k); } - //console.log(keys); - text = ""; - for (var i = 0; i < keys.length; i++ ){ - text += "
"; - text += "

" + keys[i] + "

"; - text += "
"; + init(); + function init(){ + text = "

"; + text += "
"; + text += "

ID : " + results["_id"] + "

"; + text += "

Start Date : " + results["start_date"] + "

"; + text += "

Criteria : " + results["criteria"] + "

"; + text += "

Build Tag : " + results["build_tag"] + "

"; + text += ""; + text += "
"; + text += "
"; + $("#content").html(text); + } + function add_info(){ + text = "

"; + text += "
"; + text += "

ID : " + results["_id"] + "

"; + text += "

Start Date : " + results["start_date"] + "

"; + text += "

Criteria : " + results["criteria"] + "

"; + text += "

Build Tag : " + results["build_tag"] + "

"; + text += ""; + text += "
" + text += "
"; + text += "
"; + for (var i = 0; i < keys.length; i++ ){ + text += "
"; + text += "

" + keys[i] + "

"; + text += "
"; + } + $("#content").html(text); } - $("#content").html(text); function add_test(key){ if(document.getElementById("test-" + key) == null){ @@ -228,6 +253,74 @@ document.getElementById("report").innerHTML = table; } + function create_block_report(){ + var ele = document.getElementById("block_report"); + var text = ""; + text += "
    " + text += "
  • Read
  • "; + text += "
  • Bandwidth (KB/s)
  • "; + text += "
  • IOPS
  • "; + text += "
  • Latency (nanoseconds/ns)
  • "; + text += "
  • Write
  • "; + text += "
  • Bandwidth (KB/s)
  • "; + text += "
  • IOPS
  • "; + text += "
  • Latency (nanoseconds/ns)
  • "; + text += "
  • Close
  • "; + text += "
"; + ele.innerHTML = text; + } + function close_block_report(){ + document.getElementById("block_report").innerHTML = ""; + } + function create_block_graph(key,test){ + data = {}; + for(i in report_data){ + if(report_data[i][test] == undefined && test == 'lat_ns.mean') + test = 'lat.mean'; + data[i] = report_data[i][test][key]; + } + var modal = document.getElementById('myModal'); + var modal_div = document.getElementById('modal-text'); + modal_div.innerHTML += "

"; + var name = ""; + var average = data["average"]; + if(test == "bw") + name = "Bandwidth (KB/s)"; + else if(test == "iops") + name = "IOPS"; + else + name = "Latency (nanoseconds/ns)"; + var plot_data = []; + for(i in data){ + var x = []; + var y = []; + var len = data[i]["series"].length; + for(var j = 0 ; j < len ; j++){ + x[j] = data[i]["series"][j][0]; + y[j] = data[i]["series"][j][1]; + } + var trace = { + x: x, + y: y, + type: 'scatter', + name: i + }; + plot_data.push(trace); + } + var layout = { + autosize: true, + xaxis: { + title: 'Round' + }, + yaxis: { + title: name + }, + height: 500, + width: 500, + }; + Plotly.newPlot('graph',plot_data,layout); + modal.style.display = "block"; + } document.getElementById("close").onclick = function(){ document.getElementById('modal-text').innerHTML = ""; document.getElementById("myModal").style.display = "none"; -- cgit 1.2.3-korg