simplebench.reporters.rich_table.reporter package🔗
Rich Table Reporter Module
- class simplebench.reporters.rich_table.reporter.RichTableConfig(
- *,
- name: str | None = None,
- description: str | None = None,
- sections: set[Section] | None = None,
- targets: set[Target] | None = None,
- default_targets: set[Target] | None = None,
- formats: set[Format] | None = None,
- choices: ChoicesConf | None = None,
- file_suffix: str | None = None,
- file_unique: bool | None = None,
- file_append: bool | None = None,
- subdir: str | None = None,
Bases:
ReporterConfigConfiguration for a RichTableReporter.
This class inherits from
ReporterConfigand provides a type-safe, discoverable interface for overriding the default settings of aRichTableReporter.
- class simplebench.reporters.rich_table.reporter.RichTableOptions(virtual_width: int | None = None)[source]🔗
Bases:
ReporterOptionsClass for holding Rich table reporter specific options in a Choice.
This class provides additional configuration options specific to the JSON reporter. It is accessed via the
optionsattribute of aChoiceinstance.- Variables:
virtual_width (int, optional) –
The width of the Rich table output in characters when rendered to the filesystem or via callback. Must be between 80 and 1000 characters or
None. IfNone, no width constraint is applied.The virtual width is used to determine how the table should be formatted when rendered to non-console outputs, such as files or callbacks. This allows for better control over the appearance of the table in different contexts.
- class simplebench.reporters.rich_table.reporter.RichTableReporter(
- config: RichTableConfig | None = None,
Bases:
ReporterClass for outputting benchmark results as Rich Tables.
It supports reporting operations per second and per round timing results, either separately or together, to the console, to files, and/or via a callback function.
Defined command-line flags:
--rich-table: Outputs all results as rich text tables on the console.--rich-table.ops: Outputs only operations per second results.--rich-table.timings: Outputs only per round timing results.--rich-table.memory: Outputs only memory usage results.--rich-table.peak-memory: Outputs only peak memory usage results.
Each flag supports multiple targets:
console,filesystem, andcallbackwith the default target beingconsole.- Variables:
name (str) – The unique identifying name of the reporter.
description (str) – A brief description of the reporter.
choices (Choices) – A collection of
Choicesinstances defining the reporter instance, CLI flags,Choicename, supportedSectionobjects, supported outputTargetobjects, and supported outputFormatobjects for the reporter.
- render(
- *,
- case: Case,
- section: Section,
- options: ReporterOptions,
Prints the benchmark results in a rich table format if available.
It creates a
Tableinstance containing the benchmark results for the specified section.- Parameters:
case – The
Caseinstance representing the benchmarked code.options – The options specifying the report configuration. (
RichTableOptionsis a subclass ofReporterOptions.)section – The
Sectionenum value specifying the type of results to display.
- Returns:
The
Tableinstance.