Skip to main content

StreamTelemetry

Struct StreamTelemetry 

Source
pub struct StreamTelemetry {
    pub matches: u32,
    pub home_wins: u32,
    pub draws: u32,
    pub away_wins: u32,
    pub goals: u32,
    pub shots: u32,
    pub shots_on_target: u32,
    pub goals_by_kind: BTreeMap<ShotKind, u32>,
    pub goals_by_source: BTreeMap<ShotSource, u32>,
    pub home_events: u32,
    pub away_events: u32,
    pub by_formation: BTreeMap<u8, FormationStats>,
}
Expand description

Accumulates match aggregates directly from MatchOutcome traces — everything SeasonTelemetry can’t see because the fold discards the stream. Mirrors the notebook’s report() fields.

Fields§

§matches: u32§home_wins: u32§draws: u32§away_wins: u32§goals: u32§shots: u32§shots_on_target: u32§goals_by_kind: BTreeMap<ShotKind, u32>§goals_by_source: BTreeMap<ShotSource, u32>

Goals keyed by arrival route (MATCH_MODEL.md §5) — what makes the wide-origin-goal-share target (cross + cutback, §8) computable, distinct from goals_by_kind’s coarser Finish/Header/LongShot split.

§home_events: u32

A crude possession proxy: total stream events attributed to each side (more events ⇒ more time on the ball / advancing it).

§away_events: u32§by_formation: BTreeMap<u8, FormationStats>

Keyed by Lineup::formation index into FORMATIONS.

Implementations§

Source§

impl StreamTelemetry

Source

pub fn record( &mut self, outcome: &MatchOutcome, home_formation: u8, away_formation: u8, )

Fold one match’s trace in. home_formation/away_formation are the Lineup::formation index each side fielded, for the per-formation breakdown (MATCH_MODEL.md §10 item 1’s diagnostic).

Source

pub fn goals_per_match(&self) -> f64

Source

pub fn shots_per_match(&self) -> f64

Source

pub fn home_win_rate(&self) -> f64

Source

pub fn draw_rate(&self) -> f64

Source

pub fn away_win_rate(&self) -> f64

Source

pub fn shot_on_target_rate(&self) -> f64

Source

pub fn conversion_rate(&self) -> f64

Source

pub fn headed_goal_share(&self) -> f64

Share of goals scored via ShotKind::Header — the headed-goal-share calibration target (MATCH_MODEL.md §8).

Source

pub fn wide_origin_goal_share(&self) -> f64

Share of goals arriving via ShotSource::Cross or Cutback — the wide-origin-goal-share calibration target (MATCH_MODEL.md §8: “cross + cutback”), 25-35%.

Source

pub fn home_possession_share(&self) -> f64

Home share of the possession-proxy event count.

Trait Implementations§

Source§

impl Clone for StreamTelemetry

Source§

fn clone(&self) -> StreamTelemetry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StreamTelemetry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StreamTelemetry

Source§

fn default() -> StreamTelemetry

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.