Skip to main content

Module time

Module time 

Source
Expand description

harn time — wrap a subcommand with structured phase timing.

Today only harn time run is supported. The wrapper enables both VM and LLM tracing, drives the run through the same code path as harn run, and emits a versioned JsonEnvelope with per-phase wall-clock + cache hit/miss + per-LLM-call + per-tool-call latency.

Phases are emitted in fixed order — parse, typecheck, bytecode_compile, run_setup, run_main — even when a cache hit lets us skip parse/typecheck. That keeps consumers’ shape stable so phases.length >= 5 is a safe assertion and cache: "hit" always lives on the bytecode_compile row.

Structs§

LlmCallTiming
PhaseRecord
RunTiming
Per-phase wall-clock samples recorded by the run path. Filled in by crate::commands::run when timing is requested; absent fields (e.g. parse on a cache hit) stay zero.
TimingReport
TimingTotals
ToolCallTiming

Constants§

TIME_RUN_SCHEMA_VERSION
Schema version for the harn time run --json envelope. Bump when the TimingReport shape changes in a way agents must detect.