Skip to main content

LoopGuardTripSink

Trait LoopGuardTripSink 

Source
pub trait LoopGuardTripSink: Send + Sync {
    // Required methods
    fn record_trip(&self, event: LoopGuardTripEvent);
    fn record_scan(&self, model_name: &str, mode: LoopGuardMode, at_secs: u64);
}
Expand description

Where the loop guard’s step records what it did.

Both methods run on the request path, so an implementation must return at once: queue, count and move on. A write it cannot make is counted and dropped, never waited for, and never turned into an error for the request being guarded; the count reaches a person only as a warning in the log of the process that holds the sink.

Required Methods§

Source

fn record_trip(&self, event: LoopGuardTripEvent)

Record one decision the guard took.

Source

fn record_scan(&self, model_name: &str, mode: LoopGuardMode, at_secs: u64)

Count one request the guard scanned under mode, on the day at_secs falls on. Called for every scanned request, trip or not — it is the denominator every trip is read against.

Implementors§