kaira.benchmarks.BenchmarkResultsManager

Inheritance diagram for BenchmarkResultsManager
- class kaira.benchmarks.BenchmarkResultsManager(base_dir: str | Path = 'results')[source]
Bases:
objectManages benchmark results with improved directory structure and organization.
Methods
Initialize the results manager.
Archive benchmark results older than specified days.
Remove empty directories in the results structure.
Create a comparison report from multiple benchmark results.
List available benchmark result files.
Load a benchmark result from file.
Save a single benchmark result with improved organization.
Save multiple benchmark results from a suite.
- __init__(base_dir: str | Path = 'results')[source]
Initialize the results manager.
- Parameters:
base_dir – Base directory for storing all benchmark results
- save_benchmark_result(result: BenchmarkResult, category: str = 'benchmarks', experiment_name: str | None = None, add_timestamp: bool = True) Path[source]
Save a single benchmark result with improved organization.
- Parameters:
result – The benchmark result to save
category – Category (benchmarks, suites, experiments, etc.)
experiment_name – Optional experiment name for grouping
add_timestamp – Whether to add timestamp to filename
- Returns:
Path to the saved file
- save_suite_results(results: List[BenchmarkResult], suite_name: str, experiment_name: str | None = None) Dict[str, Path][source]
Save multiple benchmark results from a suite.
- Parameters:
results – List of benchmark results
suite_name – Name of the benchmark suite
experiment_name – Optional experiment name
- Returns:
Dictionary mapping result names to file paths
- load_benchmark_result(filepath: str | Path) BenchmarkResult[source]
Load a benchmark result from file.
- list_results(category: str | None = None, experiment_name: str | None = None) List[Path][source]
List available benchmark result files.
- Parameters:
category – Specific category to list (benchmarks, suites, etc.)
experiment_name – Specific experiment to list
- Returns:
List of result file paths (excludes summary files and comparison reports)