cs_survival_kit.bench.storage ¶
Reading and writing the benchmark results file, benchmarks.json.
load ¶
Load a results file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The results file. It does not have to exist. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The stored document, or an empty one if the file does not exist. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the file was written with a different schema version. |
Source code in lib/cs_survival_kit/bench/storage.py
merge ¶
Merge benchmark entries into a results file, by benchmark name.
An entry replaces the stored entry with the same name. Every other stored entry is kept, so re-running one benchmark updates only that benchmark.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The results file. Created, along with its parent directories, if it does not exist. |
required |
results
|
Sequence[dict[str, Any]]
|
Benchmark entries, as produced by
|
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the existing file has a different schema version. |