diff options
Diffstat (limited to 'docker/storperf-master')
8 files changed, 39 insertions, 28 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): |