pub struct StatsResponse {
pub total_tasks: usize,
pub total_runs: usize,
pub attempts_total: u64,
pub runs_by_state: StatsRunsByState,
pub latest_sequence: u64,
}Expand description
Stats response payload.
This struct represents the stable schema for the stats endpoint response. Fields should not be modified without careful consideration of external dependencies that may rely on this contract.
Fields§
§total_tasks: usizeTotal number of tasks tracked.
This is derived from the authoritative task projection in the storage reducer.
total_runs: usizeTotal number of runs tracked.
This is derived from the authoritative run instance projection in the storage reducer.
attempts_total: u64Total number of attempts across all runs.
This is computed as the sum of RunInstance::attempt_count() from all
run instances in the authoritative projection. This provides a count
of all attempts that have been started for all runs.
runs_by_state: StatsRunsByStateCounts of runs by state.
Each state is counted from the authoritative run instance state projection. The map is sorted by state name for deterministic output.
latest_sequence: u64Latest sequence number processed from the WAL.
This reflects the most recent event sequence number applied to the projection state.
Implementations§
Source§impl StatsResponse
impl StatsResponse
Sourcepub fn from_projection(projection: &ReplayReducer) -> Self
pub fn from_projection(projection: &ReplayReducer) -> Self
Creates a new stats response from the projection state.
This function derives stats from the authoritative ReplayReducer state, counting runs by their current state. Empty state results in zero counts.
§Arguments
projection- The authoritative projection state from bootstrap
Trait Implementations§
Source§impl Clone for StatsResponse
impl Clone for StatsResponse
Source§fn clone(&self) -> StatsResponse
fn clone(&self) -> StatsResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more