simplebench.reporters.log package🔗

simplebench.reporters.log package

class simplebench.reporters.log.ReportLogMetadata(
*,
filepath: Path | None = None,
timestamp: float,
reports_log_path: Path | None = None,
case: Case,
choice: Choice,
)[source]🔗

Bases: object

Container for report log entry metadata.

Variables:
  • filepath – The path to the generated report file.

  • timestamp – The timestamp of the report generation.

  • reports_log_path – The path to the reports log file.

  • case – The Case instance containing benchmark results.

  • choice – The Choice instance specifying the report configuration.

Initialize ReportLogMetadata.

Parameters:
  • filepath – The path to the generated report file. If None, no file path is set.

  • timestamp – The timestamp of the report generation.

  • reports_log_path – The path to the reports log file.

  • case – The Case instance containing benchmark results.

  • choice – The Choice instance specifying the report configuration.

Raises:

SimpleBenchTypeError – If any argument is of invalid type.

property case: Case🔗

The Case instance containing benchmark results.

property choice: Choice🔗

The Choice instance specifying the report configuration.

property filepath: Path | None🔗

The path to the generated report file.

property reports_log_path: Path | None🔗

The path to the reports log file.

save_to_log() None[source]🔗

Append the metadata as a JSON entry to the reports log file.

property timestamp: float🔗

The timestamp of the report generation.

to_dict() dict[str, Any][source]🔗

Convert metadata to a dictionary for JSON serialization.

Returns:

A dictionary representation of the metadata.

Return type:

dict[str, Any]

to_json() str[source]🔗

Convert metadata to a one line JSON string.

Returns:

A JSON string representation of the metadata.

Return type:

str

Subpackages🔗

Submodules🔗