bencher.scorecard.config
Configuration for the benchmark health scorecard.
The scorecard machinery is generic; everything project-specific — how tags map to a category and display name, which metric names are synonyms, which values are fractions to show as percentages, and where reports live on disk — is supplied here so one renderer serves any project. Every field has a default, so the zero-config path still produces a page (auto-named benchmarks, no aliases).
Attributes
Classes
Where per-benchmark artifacts live under the reports directory. |
|
Project-specific inputs to the scorecard renderer. |
|
Optional page header content (title, provenance, and CI nav links). |
Module Contents
- bencher.scorecard.config.DEFAULT_OTHER_CATEGORY = 'Other'
- class bencher.scorecard.config.ReportLayout
Where per-benchmark artifacts live under the reports directory.
rootis the subdirectory holding one folder per benchmark tag (""means the reports directory itself).link_patternbuilds the relative href to a benchmark’s HTML report;{root},{tag}and{bench_name}are substituted.- root: str = ''
- link_pattern: str = '{root}/{tag}/{bench_name}.html'
- link(tag: str, bench_name: str) str
- class bencher.scorecard.config.ScorecardConfig
Project-specific inputs to the scorecard renderer.
- Parameters:
registry –
tag -> (category, display_name, description)for known benchmarks. Unregistered tags fall back to an auto-generated name inother_category.aliases –
raw_metric_name -> canonical_nameso equivalent metrics from different benchmarks share one column.percent_metrics – metric names whose value is a
0..1fraction to be rendered as a percentage rather than a bare number.layout – on-disk report layout (see
ReportLayout).other_category – fallback category for unregistered tags.
- registry: Mapping[str, tuple[str, str, str]]
- aliases: Mapping[str, str]
- percent_metrics: frozenset[str]
- layout: ReportLayout
- other_category: str = 'Other'
- category_order() list[str]
Category display order: first-appearance in the registry, Other last.
- class bencher.scorecard.config.Chrome
Optional page header content (title, provenance, and CI nav links).
Every field is optional; each nav link renders only when supplied, so the default template carries CI-flavored links harmlessly for callers that leave them blank.
- title: str = 'Benchmark Health Scorecard'
- commit_sha: str = ''
- branch: str = ''
- pr_number: str = ''
- run_url: str = ''
- repo_url: str = ''
- nightly_url: str = ''
- main_url: str = ''
- stable_url: str = ''