Skip to content

Commit

Permalink
Support reporting geometric mean by tags
Browse files Browse the repository at this point in the history
This requires the following changes to pyperf first: psf/pyperf#132
  • Loading branch information
mdboom committed May 24, 2022
1 parent 6e7b445 commit 9a7cc59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pyperformance/_benchmark_metadata.py
Expand Up @@ -214,6 +214,8 @@ def _resolve_value(field, value, rootdir):
value = value.replace(',', ' ').split()
for tag in value:
_utils.check_name(tag)
if tag == 'all':
raise ValueError("Invalid tag 'all'")
elif field == 'datadir':
if not os.path.isabs(value):
value = os.path.join(rootdir, value)
Expand Down
5 changes: 4 additions & 1 deletion pyperformance/run.py
Expand Up @@ -124,7 +124,10 @@ def add_bench(dest_suite, obj):

version = pyperformance.__version__
for res in results:
res.update_metadata({'performance_version': version})
res.update_metadata({
'performance_version': version,
'tags': bench._metadata.get('tags', [])
})

if dest_suite is not None:
dest_suite.add_benchmark(res)
Expand Down

0 comments on commit 9a7cc59

Please sign in to comment.