pub struct AdmissionController { /* private fields */ }Expand description
Admission controller for backpressure under concurrency
Enforces system-wide limits to prevent individual query budgets from being violated due to resource contention.
Implementations§
Source§impl AdmissionController
impl AdmissionController
Sourcepub fn set_class_limit(
self: &Arc<Self>,
query_class: &str,
max_concurrent: usize,
)
pub fn set_class_limit( self: &Arc<Self>, query_class: &str, max_concurrent: usize, )
Set maximum concurrent queries for a class
Sourcepub fn try_admit(
self: &Arc<Self>,
budget: &QueryBudget,
) -> Option<AdmissionTicket>
pub fn try_admit( self: &Arc<Self>, budget: &QueryBudget, ) -> Option<AdmissionTicket>
Try to admit a query
Returns None if admission is denied (should backpressure)
Sourcepub fn admit_with_backpressure(
self: &Arc<Self>,
budget: &QueryBudget,
max_wait: Duration,
) -> Option<AdmissionTicket>
pub fn admit_with_backpressure( self: &Arc<Self>, budget: &QueryBudget, max_wait: Duration, ) -> Option<AdmissionTicket>
Admit a query, waiting with backpressure if necessary
Sourcepub fn metrics(&self) -> AdmissionMetrics
pub fn metrics(&self) -> AdmissionMetrics
Get current system pressure metrics
Auto Trait Implementations§
impl !Freeze for AdmissionController
impl !RefUnwindSafe for AdmissionController
impl Send for AdmissionController
impl Sync for AdmissionController
impl Unpin for AdmissionController
impl UnsafeUnpin for AdmissionController
impl UnwindSafe for AdmissionController
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more