Skip to main content

Module execution_history

Module execution_history 

Source
Expand description

Historical execution duration tracking for ETA estimation.

Responsibilities:

  • Record phase durations for completed task executions.
  • Provide weighted average calculations for ETA estimation.
  • Persist data to .ralph/cache/execution_history.json.

Not handled here:

  • Real-time progress tracking (see app_execution.rs).
  • Actual rendering of progress indicators.

Invariants/assumptions:

  • Historical data is keyed by (runner, model, phase_count) for accuracy.
  • Recent runs are weighted higher (exponential decay).
  • Maximum 100 entries per key to prevent unbounded growth.

Structs§

ExecutionEntry
A single execution entry recording phase durations.
ExecutionHistory
Root execution history data structure.

Functions§

get_phase_averages
Get historical average durations for all phases.
load_execution_history
Load execution history from cache directory.
record_execution
Record a completed execution to history.
save_execution_history
Save execution history to cache directory.
weighted_average_duration
Calculate weighted average duration for a specific phase.