bencher.scorecard.config ======================== .. py:module:: bencher.scorecard.config .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: bencher.scorecard.config.DEFAULT_OTHER_CATEGORY Classes ------- .. autoapisummary:: bencher.scorecard.config.ReportLayout bencher.scorecard.config.ScorecardConfig bencher.scorecard.config.Chrome Module Contents --------------- .. py:data:: DEFAULT_OTHER_CATEGORY :value: 'Other' .. py:class:: 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. .. py:attribute:: root :type: str :value: '' .. py:attribute:: link_pattern :type: str :value: '{root}/{tag}/{bench_name}.html' .. py:method:: link(tag: str, bench_name: str) -> str .. py:class:: ScorecardConfig Project-specific inputs to the scorecard renderer. :param registry: ``tag -> (category, display_name, description)`` for known benchmarks. Unregistered tags fall back to an auto-generated name in :attr:`other_category`. :param aliases: ``raw_metric_name -> canonical_name`` so equivalent metrics from different benchmarks share one column. :param percent_metrics: metric names whose value is a ``0..1`` fraction to be rendered as a percentage rather than a bare number. :param layout: on-disk report layout (see :class:`ReportLayout`). :param other_category: fallback category for unregistered tags. .. py:attribute:: registry :type: Mapping[str, tuple[str, str, str]] .. py:attribute:: aliases :type: Mapping[str, str] .. py:attribute:: percent_metrics :type: frozenset[str] .. py:attribute:: layout :type: ReportLayout .. py:attribute:: other_category :type: str :value: 'Other' .. py:method:: category_order() -> list[str] Category display order: first-appearance in the registry, Other last. .. py:class:: 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. .. py:attribute:: title :type: str :value: 'Benchmark Health Scorecard' .. py:attribute:: commit_sha :type: str :value: '' .. py:attribute:: branch :type: str :value: '' .. py:attribute:: pr_number :type: str :value: '' .. py:attribute:: run_url :type: str :value: '' .. py:attribute:: repo_url :type: str :value: '' .. py:attribute:: nightly_url :type: str :value: '' .. py:attribute:: main_url :type: str :value: '' .. py:attribute:: stable_url :type: str :value: ''