pub struct DomainObservation {
pub tier: Tier,
pub outcome: ObservedOutcome,
pub timestamp: SystemTime,
}Expand description
Single fetch outcome reported to DomainStatePort::observe. The
backend turns these into its own state model (EWMA, rule-based,
histogram, etc).
§Examples
let obs = DomainObservation::now(Tier::Http, ObservedOutcome::Success);
assert_eq!(obs.tier, Tier::Http);
assert_eq!(obs.outcome, ObservedOutcome::Success);Fields§
§tier: TierThe tier this observation came from.
outcome: ObservedOutcomeWhat happened. The outcome enum is the load-bearing classification.
timestamp: SystemTimeWhen the observation was made. Backends may use this for decay / time-windowing.
Implementations§
Source§impl DomainObservation
impl DomainObservation
Sourcepub fn now(tier: Tier, outcome: ObservedOutcome) -> Self
pub fn now(tier: Tier, outcome: ObservedOutcome) -> Self
Construct an observation with timestamp = SystemTime::now().
Trait Implementations§
Source§impl Clone for DomainObservation
impl Clone for DomainObservation
Source§fn clone(&self) -> DomainObservation
fn clone(&self) -> DomainObservation
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 moreAuto Trait Implementations§
impl Freeze for DomainObservation
impl RefUnwindSafe for DomainObservation
impl Send for DomainObservation
impl Sync for DomainObservation
impl Unpin for DomainObservation
impl UnsafeUnpin for DomainObservation
impl UnwindSafe for DomainObservation
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