From ce5d34ffd43484e0965d3dc40d796a4c0ae186c6 Mon Sep 17 00:00:00 2001 From: Joe Talerico Date: Mon, 26 Sep 2016 10:47:01 -0400 Subject: [PATCH] Fix Rally metadata We need to strip all whitespace from actions. Also need to match action in the _type: error. Change-Id: I931ff583652a84040e286c08e3cf8db381d91125 --- lib/Rally.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Rally.py b/lib/Rally.py index 3c821ad10..21ec48d56 100644 --- a/lib/Rally.py +++ b/lib/Rally.py @@ -142,8 +142,14 @@ class Rally(WorkloadBase.WorkloadBase): rally_data[value] = [] rally_data[value].append(metrics[workload][value]) if len(metrics['error']) > 0: - error = {'action_name': value, + iteration = 1 + workload_name = value + if value.find('(') is not -1: + iteration = re.findall('\d+', value) + workload_name = value.split('(')[0] + error = {'action': workload_name.strip(), 'browbeat_rerun': run, + 'iteration': iteration, 'error_type': metrics['error'][0], 'error_msg': metrics['error'][1], 'result': task_id, @@ -161,7 +167,7 @@ class Rally(WorkloadBase.WorkloadBase): iteration = re.findall('\d+', workload) workload_name = workload.split('(')[0] rally_stats = {'result': task_id, - 'action': workload_name, + 'action': workload_name.strip(), 'browbeat_rerun': run, 'iteration': iteration, 'timestamp': str(es_ts).replace(" ", "T"),