Skip to main content

PerInstanceReporter

Struct PerInstanceReporter 

Source
pub struct PerInstanceReporter { /* private fields */ }
Expand description

Per-instance JSONL reporter.

No file-handle cache. The previous implementation kept every (metric_name, labels) combination’s File alive in a HashMap for the entire run, which monotonically grew the open-FD count — for workloads with many distinct label tuples (e.g. phase × profile × optimize_for × k × r), the process would exhaust its ulimit -n. Each report() call now opens, writes, and closes the target file per record. At the 30s cadence the metrics scheduler runs this on, the open() cost is dwarfed by the rest of the snapshot path.

Implementations§

Source§

impl PerInstanceReporter

Source

pub fn new(dir: impl AsRef<Path>) -> Result<Self, String>

Construct a reporter rooted at dir. The directory is created if missing; an existing directory is reused so consecutive sessions can co-locate output when desired.

Trait Implementations§

Source§

impl Reporter for PerInstanceReporter

Source§

fn report(&mut self, snapshot: &MetricSet)

Source§

fn flush(&mut self)

Source§

fn finished(&self) -> bool

Self-termination signal. After a report that leaves this true, the subscriber’s cadence-feed dispatch worker exits its loop (calling flush on the way out) — the subscriber receives no further pulses. A one-shot subscriber — e.g. a settle / stop evaluator that has set a terminal phase disposition — uses this to unregister itself without a self-join deadlock (it runs on the worker thread, so it cannot call unsubscribe on itself directly). Default false (a long-lived subscriber that never self-terminates).

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.