pub struct BreakerPolicyConfig {
pub window: WindowConfig,
pub min_request_count: u64,
pub failure_ratio_percent: u8,
pub drop_ratio_percent: u8,
pub half_open_max_calls: u32,
pub force_pass_interval: Duration,
pub sre_rejection_enabled: bool,
pub sre_k_millis: u32,
pub sre_protection: u64,
}Expand description
Advanced breaker policy used by production-oriented breakers.
Fields§
§window: WindowConfigRolling window configuration used for aggregate decisions.
min_request_count: u64Minimum request count before aggregate failure ratio can open or drop.
failure_ratio_percent: u8Failure ratio percentage that opens the breaker when enough samples exist.
drop_ratio_percent: u8Deterministic drop percentage while the rolling window is unhealthy.
half_open_max_calls: u32Maximum concurrent trial calls in half-open state.
force_pass_interval: DurationMinimum interval between forced trial calls while open.
sre_rejection_enabled: boolEnables Google SRE style client-side throttling while closed.
sre_k_millis: u32SRE throttling multiplier in millis. 1500 means k = 1.5.
sre_protection: u64Minimum total samples before SRE throttling can reject requests.
Implementations§
Source§impl BreakerPolicyConfig
impl BreakerPolicyConfig
Sourcepub fn google_sre() -> Self
pub fn google_sre() -> Self
Returns a policy using Google SRE style adaptive rejection.
Trait Implementations§
Source§impl Clone for BreakerPolicyConfig
impl Clone for BreakerPolicyConfig
Source§fn clone(&self) -> BreakerPolicyConfig
fn clone(&self) -> BreakerPolicyConfig
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 moreSource§impl Debug for BreakerPolicyConfig
impl Debug for BreakerPolicyConfig
Source§impl Default for BreakerPolicyConfig
impl Default for BreakerPolicyConfig
Source§impl PartialEq for BreakerPolicyConfig
impl PartialEq for BreakerPolicyConfig
Source§fn eq(&self, other: &BreakerPolicyConfig) -> bool
fn eq(&self, other: &BreakerPolicyConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for BreakerPolicyConfig
impl StructuralPartialEq for BreakerPolicyConfig
Auto Trait Implementations§
impl Freeze for BreakerPolicyConfig
impl RefUnwindSafe for BreakerPolicyConfig
impl Send for BreakerPolicyConfig
impl Sync for BreakerPolicyConfig
impl Unpin for BreakerPolicyConfig
impl UnsafeUnpin for BreakerPolicyConfig
impl UnwindSafe for BreakerPolicyConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request