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

DEFAULT_OTHER_CATEGORY

Classes

ReportLayout

Where per-benchmark artifacts live under the reports directory.

ScorecardConfig

Project-specific inputs to the scorecard renderer.

Chrome

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.

root is the subdirectory holding one folder per benchmark tag ("" means the reports directory itself). link_pattern builds the relative href to a benchmark’s HTML report; {root}, {tag} and {bench_name} are substituted.

root: str = ''
class bencher.scorecard.config.ScorecardConfig

Project-specific inputs to the scorecard renderer.

Parameters:
  • registrytag -> (category, display_name, description) for known benchmarks. Unregistered tags fall back to an auto-generated name in other_category.

  • aliasesraw_metric_name -> canonical_name so equivalent metrics from different benchmarks share one column.

  • percent_metrics – metric names whose value is a 0..1 fraction 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 = ''