Analysis-run performance telemetry¶
Streamlit UI load profiling (core/observability/perf.py, TRANSCRIPTX_STREAMLIT_PERF) is unrelated. This document covers analysis-run wall time, module duration_ms, and .transcriptx/run_performance.json.
Phase 0 findings¶
Optional
module_outcomes[].duration_ms/used_cachesurviveload_run_resultswithout a schema bump (RUN_RESULTS_SCHEMA_VERSIONremains 2).Prefer a narrow validator before a full typed
List[Dict]→ model migration if churn appears.
Wall-clock scope (timing_scope_version: 1)¶
Transcript¶
Start at
RunOrchestrator.runentry (perf_counter).Include preparation, execution, and all required persistence.
Stop after required persistence; write optional
run_performance.jsonoutside the measured interval, still under the same per-run lease.
Group¶
Start at entry to the group branch of
run_analysis_pipeline(perf_counter).Include sequential member execution and required group finalisation persistence (aggregation/synthesis, required group artifacts, final group
run_results.jsoncommit and validation).Stop immediately before the optional performance-sidecar write; write
.transcriptx/run_performance.jsonwhile the group writer lease remains held.
Group runs use a separate recorder; members keep their own. The group recorder is not bound as the active ContextVar during member execution (each member RunOrchestrator binds and restores its own recorder).
Group wall time is an independent end-to-end measurement. Do not calculate it by summing member wall times. Group wall may exceed the sum of member walls because it includes preparation, aggregation, and persistence overhead.
Loader statuses¶
missing | malformed | unsupported_schema | oversized | io_error — the loader cannot know “legacy”; the UI uses surrounding run metadata to distinguish old runs from telemetry loss.
Phase 2 — Retained-run snapshot exporter¶
Optional Prometheus textfile exporter over currently retained committed runs (valid run_results.json on disk). Independent of the Streamlit Performance page; GUI never depends on it.
Design¶
Each export cycle rescans transcript + group output trees and regenerates the entire metric snapshot.
Metrics are gauges (including histogram-bucket cumulative counts). When a run directory is deleted, the next scan simply omits it — gauges shrink.
No mtime-based ingest state file and no Prometheus counters that cannot delete observations.
Committed-run inventory is path-safe, deterministically ordered, capped (
max_runs), and isolates per-candidate faults. It does not useRunIndex.list_runs(user-visible artifact filter).
How to run¶
python scripts/export_run_performance_snapshot.py
python scripts/export_run_performance_snapshot.py -o /var/lib/node_exporter/textfile/transcriptx_run_perf.prom
python scripts/export_run_performance_snapshot.py --outputs-dir /path/to/outputs --max-runs 5000
Programmatic:
from transcriptx.core.observability.run_performance import (
SnapshotExportConfig,
export_retained_run_snapshot,
)
export_retained_run_snapshot(
SnapshotExportConfig(
outputs_dir=...,
group_outputs_dir=...,
textfile_path=...,
)
)
Config knobs¶
Env / flag |
Meaning |
|---|---|
|
Textfile destination (default: |
|
Scan cap (default 10000) |
|
Outputs root |
Compose / node_exporter profile wiring is deferred (plan: later).
Metric universe (low cardinality)¶
All # TYPE … gauge. Labels never include run_id, transcript_key, paths, fingerprints, or exception text. Model identity is capped/normalised; mode is quick | full | other | unknown.
Metric |
Meaning |
|---|---|
|
Count of retained committed runs |
|
Cumulative wall-duration histogram buckets (seconds) |
|
Wall duration sum / count |
|
Module outcome counts from |
|
Started-module duration buckets |
|
Logical LLM success/failure from sidecars (when present) |
|
Last-scan candidates / errors / truncated / sidecar presence |
Package layout: inventory.py (scan), exporter.py (aggregate + textfile), scripts/export_run_performance_snapshot.py.