Skip to content

Commit

Permalink
viz: now using all values found by --parse-regex
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed May 24, 2017
1 parent 3f7a18e commit e684a4d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions benchpress/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# package is not installed
pass


# We expose the suite schema as the dict `suite_schema`
def _suite_schema():
from os.path import join, realpath, dirname
Expand Down
7 changes: 4 additions & 3 deletions benchpress/visualizer/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ def visualize(args):
values = []
for job in cmd['jobs']:
for res in job['results']:
match = re.search(args.parse_regex, res['stdout'])
if res['success'] and match:
values.append(args.py_type(match.group(1)))
match_list = re.findall(args.parse_regex, res['stdout'])
if res['success'] and len(match_list) > 0:
for match in match_list:
values.append(args.py_type(match))
else:
values.append("N/A")
succeed_values = util.extract_succeed_results(cmd, args.parse_regex, args.py_type)
Expand Down
7 changes: 4 additions & 3 deletions benchpress/visualizer/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,10 @@ def extract_succeed_results(cmd, regex, py_type=int, dict_key='stdout'):
ret = []
for job in cmd.get('jobs', []):
for res in job.get('results', []):
match = re.search(regex, res[dict_key])
if res['success'] and match:
ret.append(py_type(match.group(1)))
match_list = re.findall(regex, res[dict_key])
if res['success'] and len(match_list) > 0:
for match in match_list:
ret.append(py_type(match))
return ret


Expand Down

0 comments on commit e684a4d

Please sign in to comment.