pub struct Statistics { /* private fields */ }Expand description
Operational statistics tracked by MADE.
Mutable entity: methods advance the counters, they are never mutated from outside. Saturating arithmetic prevents silent overflow under very long uptimes.
Implementations§
Source§impl Statistics
impl Statistics
pub fn new() -> Self
Sourcepub fn from_counters(
total_deliberations: u64,
total_orchestrations: u64,
total_duration: DurationMs,
per_specialty: BTreeMap<Specialty, u64>,
) -> Self
pub fn from_counters( total_deliberations: u64, total_orchestrations: u64, total_duration: DurationMs, per_specialty: BTreeMap<Specialty, u64>, ) -> Self
Rehydrate a Statistics from already-aggregated counters.
Used by persistent adapters whose storage shape keeps running sums rather than the stream of individual records. The entity’s mutators stay the single source of truth for increments; this is the matching read path.
Sourcepub fn record_deliberation(
&mut self,
specialty: &Specialty,
duration: DurationMs,
)
pub fn record_deliberation( &mut self, specialty: &Specialty, duration: DurationMs, )
Record that a deliberation for specialty completed in duration.
Sourcepub fn record_orchestration(&mut self, duration: DurationMs)
pub fn record_orchestration(&mut self, duration: DurationMs)
Record that an orchestration (deliberate + execute) completed.
pub fn total_deliberations(&self) -> u64
pub fn total_orchestrations(&self) -> u64
pub fn total_duration(&self) -> DurationMs
pub fn per_specialty(&self) -> &BTreeMap<Specialty, u64>
Sourcepub fn average_duration_ms(&self) -> f64
pub fn average_duration_ms(&self) -> f64
Average duration per operation across all deliberations and orchestrations. Returns zero when no operation has been recorded.
Trait Implementations§
Source§impl Clone for Statistics
impl Clone for Statistics
Source§fn clone(&self) -> Statistics
fn clone(&self) -> Statistics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Statistics
impl Debug for Statistics
Source§impl Default for Statistics
impl Default for Statistics
Source§fn default() -> Statistics
fn default() -> Statistics
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Statistics
impl<'de> Deserialize<'de> for Statistics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Statistics
Source§impl PartialEq for Statistics
impl PartialEq for Statistics
Source§impl Serialize for Statistics
impl Serialize for Statistics
impl StructuralPartialEq for Statistics
Auto Trait Implementations§
impl Freeze for Statistics
impl RefUnwindSafe for Statistics
impl Send for Statistics
impl Sync for Statistics
impl Unpin for Statistics
impl UnsafeUnpin for Statistics
impl UnwindSafe for Statistics
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
Mutably borrows from an owned value. Read more