diff options
Diffstat (limited to 'docker')
9 files changed, 72 insertions, 50 deletions
diff --git a/docker/storperf-master/storperf/db/graphite_db.py b/docker/storperf-master/storperf/db/graphite_db.py index aa71855..8ebd22e 100644 --- a/docker/storperf-master/storperf/db/graphite_db.py +++ b/docker/storperf-master/storperf/db/graphite_db.py @@ -33,19 +33,20 @@ class GraphiteDB(object): return result - def fetch_series(self, workload, metric, io_type, time, duration): + def fetch_series(self, function, workload, metric, + io_type, time, duration): series = [] end = time start = end - duration request = ("http://%s:%s/graphite/render/?target=" - "averageSeries(%s.*.jobs.1.%s.%s)" + "%s(%s.*.jobs.1.%s.%s)" "&format=json" "&from=%s" "&until=%s" % (self.graphite_host, self.graphite_port, - workload, io_type, metric, + function, workload, io_type, metric, start, end)) self.logger.debug("Calling %s" % (request)) diff --git a/docker/storperf-master/storperf/db/test_results_db.py b/docker/storperf-master/storperf/db/test_results_db.py index 8e9c5ef..3ee09d2 100644 --- a/docker/storperf-master/storperf/db/test_results_db.py +++ b/docker/storperf-master/storperf/db/test_results_db.py @@ -17,17 +17,12 @@ def push_results_to_db(db_url, details, logger): """ url = db_url + "/results" - params = details["report"] - - if logger: - logger.info("popped params= %s" % params) - headers = {'Content-Type': 'application/json'} try: if logger: - jsonified_params = json.dumps(params) + jsonified_params = json.dumps(details) logger.info("Pushing results to %s" % (url)) - logger.debug("Parameters: %s" % jsonified_params[:1024]) + logger.debug("Parameters: %s" % details) r = requests.post(url, data=jsonified_params, headers=headers) if logger: logger.debug(r) @@ -37,5 +32,5 @@ def push_results_to_db(db_url, details, logger): except Exception: if logger: logger.exception("Error [push_results_to_db('%s', '%s')]:" % - (db_url, params)) + (db_url, details)) return None diff --git a/docker/storperf-master/storperf/storperf_master.py b/docker/storperf-master/storperf/storperf_master.py index 8a67048..c84a02c 100644 --- a/docker/storperf-master/storperf/storperf_master.py +++ b/docker/storperf-master/storperf/storperf_master.py @@ -422,11 +422,6 @@ class StorPerfMaster(object): metadata = self.fetch_metadata(job) if 'report' in metadata: metadata['report']['_id'] = job - metadata['report']['start_date'] = \ - metadata['report']['start_time'] - metadata['report']['end_date'] = \ - metadata['report']['end_time'] - metadata['report']['_id'] = job job_report['results'].append(metadata['report']) return job_report @@ -538,7 +533,14 @@ class StorPerfMaster(object): loader = loading.get_plugin_loader('password') auth = loader.load_from_options(**creds) - sess = session.Session(auth=auth) + + https_cacert = os.getenv('OS_CACERT', '') + https_insecure = os.getenv('OS_INSECURE', '').lower() == 'true' + + self.logger.info("cacert=%s" % https_cacert) + + sess = session.Session(auth=auth, + verify=(https_cacert or not https_insecure)) self.logger.debug("Looking up orchestration endpoint") heat_endpoint = sess.get_endpoint(auth=auth, @@ -546,13 +548,13 @@ class StorPerfMaster(object): endpoint_type='publicURL') self.logger.debug("Orchestration endpoint is %s" % heat_endpoint) - token = sess.get_token(auth=auth) self._heat_client = heatclient.Client( "1", endpoint=heat_endpoint, - token=token) + session=sess) self.logger.debug("Creating cinder client") - self._cinder_client = cinderclient.Client("2", session=sess) + self._cinder_client = cinderclient.Client("2", session=sess, + cacert=https_cacert) self.logger.debug("OpenStack authentication complete") diff --git a/docker/storperf-master/storperf/test_executor.py b/docker/storperf-master/storperf/test_executor.py index 629ae15..96c2ee4 100644 --- a/docker/storperf-master/storperf/test_executor.py +++ b/docker/storperf-master/storperf/test_executor.py @@ -230,7 +230,12 @@ class TestExecutor(object): for job in jobs: if self.job_db.job_id == job_id and self._terminated is False: status = "Running" - result[job] = status + result['Status'] = status + result['Workloads'] = self.workload_status + result['TestResultURL'] = self.result_url + else: + result[job] = {} + result[job]['Status'] = "Completed" return result diff --git a/docker/storperf-master/storperf/utilities/data_handler.py b/docker/storperf-master/storperf/utilities/data_handler.py index 8a69180..b85517f 100644 --- a/docker/storperf-master/storperf/utilities/data_handler.py +++ b/docker/storperf-master/storperf/utilities/data_handler.py @@ -43,7 +43,12 @@ class DataHandler(object): for io_type in ('read', 'write'): metrics[metric][io_type] = {} - series = self._lookup_prior_data(executor, metric, io_type) + function = "sumSeries" + if 'mean' in metric: + function = "averageSeries" + + series = self._lookup_prior_data(executor, metric, io_type, + function) series = self._convert_timestamps_to_samples( executor, series) steady = self._evaluate_prior_data( @@ -85,7 +90,7 @@ class DataHandler(object): if steady_state and not workload_name.startswith('_'): executor.terminate_current_run() - def _lookup_prior_data(self, executor, metric, io_type): + def _lookup_prior_data(self, executor, metric, io_type, function): workload = executor.current_workload graphite_db = GraphiteDB() @@ -93,7 +98,8 @@ class DataHandler(object): # data we just sent to it now = int(time.time()) backtime = 60 * (executor.steady_state_samples + 1) - data_series = graphite_db.fetch_series(workload, + data_series = graphite_db.fetch_series(function, + workload, metric, io_type, now, diff --git a/docker/storperf-master/storperf/workloads/_base_workload.py b/docker/storperf-master/storperf/workloads/_base_workload.py index c045278..d5282d7 100644 --- a/docker/storperf-master/storperf/workloads/_base_workload.py +++ b/docker/storperf-master/storperf/workloads/_base_workload.py @@ -23,7 +23,7 @@ class _base_workload(object): 'bs': '64k', 'iodepth': '1', 'numjobs': '1', - 'loops': '20', + 'loops': '200', 'output-format': 'json', 'status-interval': '60' } diff --git a/docker/storperf-master/tests/db_tests/graphite_db_test.py b/docker/storperf-master/tests/db_tests/graphite_db_test.py index d4c6fb6..d5fbbfc 100644 --- a/docker/storperf-master/tests/db_tests/graphite_db_test.py +++ b/docker/storperf-master/tests/db_tests/graphite_db_test.py @@ -83,9 +83,10 @@ class GraphiteDBTest(unittest.TestCase): [1480456040, 219.28], [1480456050, 217.75]] - mock_requests.side_effect = (response, ) + mock_requests.side_effect = (response,) - actual = self.graphdb.fetch_series("workload", "iops", + actual = self.graphdb.fetch_series("averageSeries", + "workload", "iops", "write", 0, 600) self.assertEqual(expected, actual) diff --git a/docker/storperf-master/tests/utilities_tests/data_handler_test.py b/docker/storperf-master/tests/utilities_tests/data_handler_test.py index 8c7deb5..35150dd 100644 --- a/docker/storperf-master/tests/utilities_tests/data_handler_test.py +++ b/docker/storperf-master/tests/utilities_tests/data_handler_test.py @@ -85,7 +85,8 @@ class DataHandlerTest(unittest.TestCase): 8, 8192)) - actual = self.data_handler._lookup_prior_data(self, 'read', 'iops') + actual = self.data_handler._lookup_prior_data(self, "sumSeries", + 'read', 'iops') self.assertEqual(expected, actual) def test_short_sample(self): diff --git a/docker/storperf-reporting/src/templates/plot_multi_data.html b/docker/storperf-reporting/src/templates/plot_multi_data.html index 3e64538..9a81599 100644 --- a/docker/storperf-reporting/src/templates/plot_multi_data.html +++ b/docker/storperf-reporting/src/templates/plot_multi_data.html @@ -35,8 +35,8 @@ text += "<h4> Criteria : " + results[i]["criteria"] + "</h4>"; text += "<h4> Build Tag : " + results[i]["build_tag"] + "</h4>"; text += "<button type='button' class='btn btn-default btn-lg' id='para-"+ ids[i] + - "' onclick=add_info('" + ids[i] + "')> Click here to view details </button>"; - text += "</div>"; + "' onclick=add_info('" + ids[i] + "')> Click here to view details </button>"; + text += "</div>"; } $("#content").html(text); } @@ -60,15 +60,15 @@ text += "<h4> Criteria : " + results[i]["criteria"] + "</h4>"; text += "<h4> Build Tag : " + results[i]["build_tag"] + "</h4>"; text += "<button type='button' class='btn btn-default btn-lg' onclick=init()>Go Back</button>"; - text += "<button type='button' class='btn btn-default btn-lg' onclick=create_block_report() style='float: right;'> Steady State Convergence Report - All Block Sizes </button>"; + text += "<button type='button' class='btn btn-default btn-lg' onclick=create_block_report() style='float: right;'> Steady State Convergence Report - All Runs </button>"; text += "<div class='row' id='block_report'></div>" text += "</div>"; for (var i = 0; i < keys.length; i++ ){ text += "<div class='row' id='row-"+ keys[i] +"'>"; text += "<h4 onclick=add_test('" + keys[i] + "')>" + keys[i] + "</h4>"; text += "</div>"; - } - $("#content").html(text); + } + $("#content").html(text); } function add_test(key){ if(document.getElementById("test-" + key) == null){ @@ -94,7 +94,7 @@ for( item in report_data[key][test] ){ var state = report_data[key][test][item]["steady_state"]; text += "<li onclick=create_modal('" + key + "','" + test + "','" + item + "') id='"; - text += key + "-" + test + "-" + item + "'>" + item + " (steady state: " + state +")"; + text += key + "-" + test + "-" + item + "'>" + item + " (steady state: " + state +")"; text += "<br><div id='modal-" + key + "-" + test + "-" + item + "'>"; text += '<div class="modal-content-'+ key + '-' + test + '-' + item +'">'; text += '<div id="modal-text-'+ key + '-' + test + '-' + item +'"></div>'; @@ -131,9 +131,13 @@ else name = "Latency (nanoseconds/ns)"; var len = data["series"].length; + var max_y = 1.25*average for(var i = 0 ; i < len ; i++){ x[i] = data["series"][i][0]; y[i] = data["series"][i][1]; + if(y[i] > max_y){ + max_y=y[i] + } } var trace1 = { x: x, @@ -146,40 +150,41 @@ title: 'Round' }, yaxis: { - title: name + title: name, + range: [0, max_y] } }; // Creating average plot in var trace2 - var average_y = []; + var average_plus_y = []; for(var i = 0; i < len ;i++ ){ - average_y.push(average) + average_plus_y.push(1.2*average) } var trace2 = { x: x, - y: average_y, - name: 'Average', + y: average_plus_y, + name: 'Average + 20%', type: 'scatter' }; // Creating average plot in var trace3 - var average_plus_y = []; + var average_y = []; for(var i = 0; i < len ;i++ ){ - average_plus_y.push(1.1*average) + average_y.push(average) } var trace3 = { x: x, - y: average_plus_y, - name: '110%*Average', + y: average_y, + name: 'Average', type: 'scatter' }; // Creating average plot in var trace4 var average_minus_y = []; for(var i = 0; i < len ;i++ ){ - average_minus_y.push(0.9*average) + average_minus_y.push(0.8*average) } var trace4 = { x: x, y: average_minus_y, - name: '90%*Average', + name: 'Average - 20%', type: 'scatter' }; // Creating slope plot in var trace5 @@ -223,7 +228,8 @@ "</td><td> Measured Maximum Slope Excursion: " + data["slope"] + "</td></tr>"; table += "</tbody></table>"; document.getElementById("report-" + key + "-" + test + "-" + item).innerHTML = table; - } function create_block_report(){ + } + function create_block_report(){ var ele = document.getElementById("block_report"); var text = ""; text += "<ul class='list-group' style='margin: auto;'>" @@ -283,10 +289,10 @@ 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]; + data[i] = report_data[i][test][key]; } document.getElementById('close-block-report-'+key+'-'+test).style.display = 'block'; - var modal = document.getElementById('modal-block-report-'+key+'-'+test); + var modal = document.getElementById('modal-block-report-'+key+'-'+test); var modal_div = document.getElementById('modal-text-block-report-'+key+'-'+test); modal_div.innerHTML += "<div id='graph-"+key+ "-"+ test+ "'></div><br><div id='report-"+key+ "-"+ test+ "'></div>"; var name = ""; @@ -298,6 +304,7 @@ else name = "Latency (nanoseconds/ns)"; var plot_data = []; + var max_y = 0 for(i in data){ var x = []; var y = []; @@ -305,6 +312,9 @@ for(var j = 0 ; j < len ; j++){ x[j] = data[i]["series"][j][0]; y[j] = data[i]["series"][j][1]; + if(y[j] > max_y){ + max_y=y[j] + } } var trace = { x: x, @@ -320,7 +330,8 @@ title: 'Round' }, yaxis: { - title: name + title: name, + range: [0, max_y] }, }; Plotly.newPlot('graph-'+key+'-'+test,plot_data,layout); @@ -330,4 +341,4 @@ </script> </body> -</html>
\ No newline at end of file +</html> |