pub struct ClientLoadSignal { /* private fields */ }Expand description
A manually-fed signal representing downstream client throttling.
Use ClientLoadSignal::instrument_storage to automatically record successful storage
operations and backend rate-limit errors. Callers can also feed observations directly through
ClientLoadSignalHandle.
Implementations§
Source§impl ClientLoadSignal
impl ClientLoadSignal
Sourcepub fn handle(&self) -> ClientLoadSignalHandle
pub fn handle(&self) -> ClientLoadSignalHandle
Returns a cloneable handle for recording client health observations.
Sourcepub fn instrument_storage(
&self,
client: Arc<dyn StorageClient>,
) -> Arc<dyn StorageClient>
pub fn instrument_storage( &self, client: Arc<dyn StorageClient>, ) -> Arc<dyn StorageClient>
Wraps a storage client so its successful and rate-limited operations feed this signal.
Trait Implementations§
Source§impl Default for ClientLoadSignal
impl Default for ClientLoadSignal
Source§impl LoadSignal for ClientLoadSignal
impl LoadSignal for ClientLoadSignal
Source§fn overload_threshold(&self) -> f32
fn overload_threshold(&self) -> f32
Returns the utilization threshold at which this signal is overloaded.
Source§fn sample(&self, window: Duration) -> Vec<LoadSnapshot>
fn sample(&self, window: Duration) -> Vec<LoadSnapshot>
Returns observations from the requested recent window.
Auto Trait Implementations§
impl Freeze for ClientLoadSignal
impl RefUnwindSafe for ClientLoadSignal
impl Send for ClientLoadSignal
impl Sync for ClientLoadSignal
impl Unpin for ClientLoadSignal
impl UnsafeUnpin for ClientLoadSignal
impl UnwindSafe for ClientLoadSignal
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