oct
Loading...
Searching...
No Matches
oct.timing.report Namespace Reference

Functions

dict statistics (list[float] values)
dict _load_baseline (Path root)
dict timing_report (Path root, int last=20)
None write_baseline (Path root, dict report, *, bool force_host=False)
dict session_report (Path path)
str render_report (dict report)

Detailed Description

Purpose
-------
Report stage and session timings against host baselines.

Responsibilities
----------------
- Keep local timing data bounded, private and advisory.

Diagnostics
-----------
Domain: GENERAL
Levels:
    L1 -- instrumentation failures
    L2 -- lifecycle
    L3 -- semantic details
    L4 -- deep tracing

Contracts
---------
- Timing instrumentation never changes the wrapped operation's outcome.
- Only the fixed timing schema is persisted; command arguments are never stored.

Dependencies
------------
- oc_diagnostics (structured timing diagnostics)
- oct.core.octrc (load_octrc_safe for the project's tier budget overrides)
- oct.timing.ledger (read_records for the recorded stage timings)
- oct.timing.tiers (each stage's tier and effective tier budget)
- oct.tools.atomic_write (atomic_write_text for saving the host timing baseline)

Function Documentation

◆ _load_baseline()

dict oct.timing.report._load_baseline ( Path root)
protected
Read baseline strictly so a malformed file cannot be overwritten.

Definition at line 57 of file report.py.

Here is the caller graph for this function:

◆ render_report()

str oct.timing.report.render_report ( dict report)
Render precisely the same statistics exposed in JSON.

Definition at line 155 of file report.py.

◆ session_report()

dict oct.timing.report.session_report ( Path path)
Pair calls by session and call ID and sum token samples per turn.

Definition at line 115 of file report.py.

Here is the call graph for this function:

◆ statistics()

dict oct.timing.report.statistics ( list[float] values)
Return median and nearest-rank p95 (including small samples).

Definition at line 52 of file report.py.

Here is the caller graph for this function:

◆ timing_report()

dict oct.timing.report.timing_report ( Path root,
int last = 20 )
Aggregate the current host and CPU count, excluding deliberate waits.

Definition at line 67 of file report.py.

Here is the call graph for this function:

◆ write_baseline()

None oct.timing.report.write_baseline ( Path root,
dict report,
* ,
bool force_host = False )
Preserve all hosts; require acknowledgment before adding a foreign host.

Definition at line 99 of file report.py.

Here is the call graph for this function: