pub struct LogShipper { /* private fields */ }Expand description
The handle the request path holds. Cloneable, cheap, and non-blocking to use.
Implementations§
Source§impl LogShipper
impl LogShipper
pub fn stats(&self) -> &Arc<ShipStats> ⓘ
Sourcepub fn record(&self, rec: AccessRecord)
pub fn record(&self, rec: AccessRecord)
Hand a record to the shipper. Never blocks and never fails the caller.
try_send, not send().await: this is called from the response path of every request. An
await here would couple request latency to collector latency, which is the precise failure
this module exists to avoid — an access-log pipeline is not worth a millisecond of p99, let
alone the unbounded stall a wedged collector would cause.
A full queue drops the NEWEST record rather than evicting the oldest. Both lose data; this one is O(1) with no locking, and during a collector outage the older records are the ones already batched and about to go out. Dropping is counted, never silent.
Trait Implementations§
Source§impl Clone for LogShipper
impl Clone for LogShipper
Source§fn clone(&self) -> LogShipper
fn clone(&self) -> LogShipper
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 LogShipper
impl RefUnwindSafe for LogShipper
impl Send for LogShipper
impl Sync for LogShipper
impl Unpin for LogShipper
impl UnsafeUnpin for LogShipper
impl UnwindSafe for LogShipper
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