#[non_exhaustive]pub struct FlushStats {Show 19 fields
pub root_writes: u32,
pub writes_suppressed: u32,
pub nodes_marked_check: u32,
pub nodes_marked_dirty: u32,
pub max_propagation_depth: u32,
pub effects_queued: u32,
pub effects_coalesced: u32,
pub effects_run: u32,
pub effects_skipped: u32,
pub effects_disposed: u32,
pub effects_pending: u32,
pub computed_verified: u32,
pub computed_recomputed: u32,
pub computed_changed: u32,
pub computed_suppressed: u32,
pub edges_added: u32,
pub edges_removed: u32,
pub jobs_at_start: u32,
pub jobs_at_finish: u32,
}Expand description
What one flush did.
Delivered on DiagnosticEvent::FlushFinished. An
idle window’s flush should be all zeroes, and that is the point: without this, “a flush
happened” and “a flush did work” are indistinguishable, and an idle application’s cost is a
CPU percentage rather than a number.
§Availability
Unlike GraphStats, these counters are maintained only while a diagnostic subscription is
active. The distinction is not arbitrary: GraphStats backs a query that can be called at
any moment, so it must always be true, whereas FlushStats is only ever observed by being
delivered in an event, and an event nobody subscribed to is not delivered. Counters that back
a query are always maintained; counters that back an event follow the event.
§Attribution
Work is attributed to the next flush that closes, and counted exactly once.
- Work performed during a flush belongs to the innermost flush open at the time. Flushes nest
— a re-entrant
Reactor::flush_nowfrom inside a job opens a genuine inner epoch — and an inner flush’s totals are not rolled up into the enclosing one, so summing the flushes in a capture double-counts nothing. - Work performed outside any flush — most importantly the writes that scheduled it — is
handed to the flush that drains it. A write and the effect run it causes therefore appear
in the same totals, which is what makes
root_writesanswer “what set this flush off”. The corollary: work never followed by a flush is never reported. Disposing an effect and then stopping, for example, accumulates a disposal that no flush arrives to carry. That is deliberate — a drain with an empty queue is not a flush, and making one happen because diagnostics are subscribed would break the rule that subscribing never changes behaviour. In an application, where flushes keep coming, it is invisible.
§A settled graph does not flush
A drain with nothing to drain is not a flush: it opens no epoch and reports nothing. So the
signature of an idle application is no flushes at all, not a stream of empty ones. An
empty FlushStats still occurs for a boundary a consumer declared with
Reactor::external_flush, which is reported whether or not
the drain found work — see examples/idle_audit.rs.
§No durations
Adaptite reads no clock. Every field here is a count. A consumer that wants a duration
timestamps the FlushStarted/FlushFinished pair itself.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.root_writes: u32Writes and explicit triggers on source nodes that reached the graph.
writes_suppressed: u32Writes discarded by a source’s own equality check before reaching the graph.
Work that happened and produced nothing. root_writes + writes_suppressed is how often
something tried to write; root_writes alone is how often it mattered. A large ratio
between them is a producer running more often than it needs to, which is invisible from
the propagation side because a suppressed write propagates nothing by definition.
nodes_marked_check: u32Marks delivered to observers saying a computed input may have changed.
nodes_marked_dirty: u32Marks delivered to observers saying a direct dependency definitely changed.
max_propagation_depth: u32Deepest chain of marking walked in one propagation.
One write reaching an effect directly is depth 1; through two memos, depth 3.
effects_queued: u32Effects that acquired a pending run.
effects_coalesced: u32Invalidations absorbed by an effect that already had a run pending.
effects_run: u32Effect bodies executed.
effects_skipped: u32Effects whose verification proved their inputs unchanged, so the body was skipped.
effects_disposed: u32Effects disposed.
effects_pending: u32Effects still holding a pending run when the flush closed.
computed_verified: u32Check-marked computed nodes that verified their inputs.
computed_recomputed: u32Computations that ran.
computed_changed + computed_suppressed is at most this, not equal to it: a
computation that unwound published nothing and is neither. The difference is the number
that failed.
computed_changed: u32Computations that published a new value.
computed_suppressed: u32Computations whose comparator judged the value unchanged, sparing everything downstream.
edges_added: u32Dependency edges recorded.
edges_removed: u32Dependency edges retracted.
jobs_at_start: u32Jobs queued when the flush opened.
jobs_at_finish: u32Jobs still queued when the flush closed.
Non-zero after a panicking job: the flush hands what is left to a fresh one.
Implementations§
Source§impl FlushStats
impl FlushStats
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true when the flush did no reactive work at all.
A settled graph does not flush at all, so an idle application usually asserts that no
flush arrived. This is for the flush an Reactor::external_flush
reports over a settled graph — the boundary was declared, but there was nothing to do.
Deliberately ignores jobs_at_start,
jobs_at_finish and effects_pending,
which describe outstanding state rather than work this flush did. An empty flush with a
non-zero effects_pending is a real and meaningful combination: nothing happened here,
and an effect is still sitting unrun in a consumer-owned lane.
Trait Implementations§
Source§impl Clone for FlushStats
impl Clone for FlushStats
impl Copy for FlushStats
Source§impl Debug for FlushStats
impl Debug for FlushStats
Source§impl Default for FlushStats
impl Default for FlushStats
impl Eq for FlushStats
Source§impl PartialEq for FlushStats
impl PartialEq for FlushStats
impl StructuralPartialEq for FlushStats
Auto Trait Implementations§
impl Freeze for FlushStats
impl RefUnwindSafe for FlushStats
impl Send for FlushStats
impl Sync for FlushStats
impl Unpin for FlushStats
impl UnsafeUnpin for FlushStats
impl UnwindSafe for FlushStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.