trinity.perf package#

Submodules#

Module contents#

Performance tooling package for Trinity.

class trinity.perf.ExplorerPerfOptions(config_path: 'str', output_path: 'str', monitor_interval: 'float' = 2.0, total_steps: 'int' = 5, timeout: 'Optional[float]' = None)[source]#

Bases: object

config_path: str#
output_path: str#
monitor_interval: float#
total_steps: int#
timeout: float | None#
__init__(config_path: str, output_path: str, monitor_interval: float = 2.0, total_steps: int = 5, timeout: float | None = None) None#
class trinity.perf.ResourceSampler(interval_seconds: float, backend: SystemResourceBackend | None = None)[source]#

Bases: object

Periodically collect system resource samples in a background thread.

__init__(interval_seconds: float, backend: SystemResourceBackend | None = None) None[source]#
samples() list[ResourceSample][source]#

Return a snapshot of all collected samples.

start() None[source]#

Start sampling in the background.

stop() list[ResourceSample][source]#

Stop sampling and return the collected samples.

class trinity.perf.TensorBoardScalarReader(log_dir: str)[source]#

Bases: object

Read scalar metrics from TensorBoard event files.

__init__(log_dir: str)[source]#
trinity.perf.collect_step_metrics(metric_map: dict[str, dict[int, float]]) list[dict[str, Any]][source]#

Build per-step metrics from TensorBoard scalars.

trinity.perf.run_explorer_perf(options: ExplorerPerfOptions) dict[str, Any][source]#

Run Explorer perf collection and return the result payload.

trinity.perf.write_explorer_perf_output(output_path: str, payload: dict[str, Any]) None[source]#

Write the final payload to disk.