Results¤
Serializable benchmark result containers with typed fields for throughput, latency, and resource metrics.
See Also¤
- Benchmarking Overview - All benchmarking tools
- Timing - Timing collection
- Statistics - Statistical analysis
- Benchmarking Guide
calibrax.core.result ¤
Unified benchmark result container.
Composes TimingSample, ResourceSummary, and Metric into a single serializable BenchmarkResult with JSON save/load support.
BenchmarkResult
dataclass
¤
BenchmarkResult(*, name: str, domain: str = '', tags: dict[str, str] = dict(), timing: TimingSample | None = None, resources: ResourceSummary | None = None, metrics: dict[str, Metric] = dict(), metadata: dict[str, Any] = dict(), config: dict[str, Any] = dict(), timestamp: float = time())
Framework-agnostic benchmark result.
Composes timing, resource, and metric measurements into a single serializable container for cross-framework comparison.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Benchmark name identifier. |
domain |
str
|
Domain category (e.g., "computer_vision", "nlp"). |
tags |
dict[str, str]
|
Flexible key-value tags (framework, model, variant, etc.). |
timing |
TimingSample | None
|
Timing measurements from TimingCollector. |
resources |
ResourceSummary | None
|
Resource usage from ResourceMonitor. |
metrics |
dict[str, Metric]
|
Named metric values with optional confidence intervals. |
metadata |
dict[str, Any]
|
Additional metadata (system info, hyperparameters, etc.). |
config |
dict[str, Any]
|
Benchmark configuration parameters. |
timestamp |
float
|
Unix timestamp of the benchmark run. |
metrics
class-attribute
instance-attribute
¤
metadata
class-attribute
instance-attribute
¤
to_dict ¤
from_dict
classmethod
¤
from_dict(data: dict[str, Any]) -> BenchmarkResult
Deserialize from a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any]
|
Dictionary with benchmark result fields. |
required |
Returns:
| Type | Description |
|---|---|
BenchmarkResult
|
Reconstructed BenchmarkResult instance. |
save ¤
save(filepath: Path) -> None
Save result to a JSON file, creating parent directories.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
Path
|
Path to the output JSON file. |
required |
load
classmethod
¤
load(filepath: Path) -> BenchmarkResult
Load a BenchmarkResult from a JSON file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
Path
|
Path to the JSON file. |
required |
Returns:
| Type | Description |
|---|---|
BenchmarkResult
|
Reconstructed BenchmarkResult instance. |