bundle.perf_report.storage.cprofile

HDF5 storage for cProfile profiling data.

Classes

CProfileStorage

Store and retrieve cProfile data in HDF5, keyed by version and platform.

Module Contents

class bundle.perf_report.storage.cprofile.CProfileStorage(h5_path: pathlib.Path | str)

Store and retrieve cProfile data in HDF5, keyed by version and platform.

HDF5 layout:

/<version>/<platform_id>/meta       (attrs: machine_id, platform_id, bundle_version, timestamp)
/<version>/<platform_id>/profiles/<prof_name>  (structured dataset)
h5_path
save(profiles: list[bundle.perf_report.extractor.CProfileData], machine_id: str, bundle_version: str, platform_id: str, platform_meta: dict | None = None)

Write profiles under /<version>/<platform_id>/, appending to existing file.

list_versions() list[str]
list_platforms(version: str) list[str]
load_meta(version: str, platform_id: str) dict
load_profiles(version: str, platform_id: str) list[bundle.perf_report.extractor.CProfileData]

Load all profiles for a specific version+platform.

classmethod from_directory(prof_dir: pathlib.Path, h5_path: pathlib.Path, machine_id: str, bundle_version: str, platform_id: str, platform_meta: dict | None = None) CProfileStorage

Extract all .prof files from a directory and save to HDF5.