Timings API

Public API for pipeline timing artifacts.

pstrain.api.timings.format_summary(document)[source]

Per-stage rollup as tab-separated rows, so a run pastes into a spreadsheet.

Values are bare numbers and the units live in the header: 7.20s and 0.75x read well in a terminal but are text to every tool that would otherwise sum or sort the column.

Parameters:

document (dict[str, Any])

Return type:

str

pstrain.api.timings.load_document(project_dir, run_id=None)[source]
Parameters:
  • project_dir (Path)

  • run_id (str | None)

Return type:

tuple[Path, dict[str, Any]]