pub struct RpcResilienceConfig {Show 16 fields
pub breaker_enabled: bool,
pub breaker_failure_threshold: u32,
pub breaker_reset_timeout: Duration,
pub breaker_sre_enabled: bool,
pub breaker_sre_k_millis: u32,
pub breaker_sre_protection: u64,
pub max_concurrency: Option<usize>,
pub request_timeout: Duration,
pub shedding_enabled: bool,
pub shedding_max_in_flight: Option<usize>,
pub shedding_min_request_count: u64,
pub shedding_max_latency: Duration,
pub shedding_cpu_threshold_millis: u32,
pub shedding_cool_off: Duration,
pub shedding_window_buckets: usize,
pub shedding_window_bucket_duration: Duration,
}Expand description
RPC resilience configuration shared by future tonic layers.
Fields§
§breaker_enabled: boolWhether RPC breaker integration should be enabled by adapters.
breaker_failure_threshold: u32Consecutive failures that open an RPC breaker.
breaker_reset_timeout: DurationTime before an open RPC breaker allows a half-open trial call.
breaker_sre_enabled: boolWhether the RPC breaker uses Google SRE style adaptive rejection.
breaker_sre_k_millis: u32SRE breaker multiplier in millis. 1500 means k = 1.5.
breaker_sre_protection: u64Minimum total samples before SRE breaker rejection can start.
max_concurrency: Option<usize>Optional maximum number of in-flight RPC calls.
request_timeout: DurationPer-call timeout used by generated service adapters.
shedding_enabled: boolWhether adaptive RPC shedding is enabled.
shedding_max_in_flight: Option<usize>Maximum in-flight calls used by the adaptive shedder.
shedding_min_request_count: u64Minimum samples before latency-based shedding can reject.
shedding_max_latency: DurationAverage latency threshold used by adaptive shedding.
shedding_cpu_threshold_millis: u32CPU usage threshold used by adaptive shedding, where 1000 means 100%.
shedding_cool_off: DurationCool-off duration after a recent adaptive shedder drop.
shedding_window_buckets: usizeNumber of buckets used by adaptive shedder rolling windows.
shedding_window_bucket_duration: DurationDuration represented by each adaptive shedder bucket.
Implementations§
Source§impl RpcResilienceConfig
impl RpcResilienceConfig
Sourcepub fn production_defaults() -> Self
pub fn production_defaults() -> Self
Returns a production-oriented resilience profile for unary RPC calls.
Sourcepub fn go_zero_defaults() -> Self
👎Deprecated: use production_defaults instead
pub fn go_zero_defaults() -> Self
use production_defaults instead
Returns a production-oriented resilience profile for unary RPC calls.
Trait Implementations§
Source§impl Clone for RpcResilienceConfig
impl Clone for RpcResilienceConfig
Source§fn clone(&self) -> RpcResilienceConfig
fn clone(&self) -> RpcResilienceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RpcResilienceConfig
impl Debug for RpcResilienceConfig
Source§impl Default for RpcResilienceConfig
impl Default for RpcResilienceConfig
Source§impl PartialEq for RpcResilienceConfig
impl PartialEq for RpcResilienceConfig
Source§fn eq(&self, other: &RpcResilienceConfig) -> bool
fn eq(&self, other: &RpcResilienceConfig) -> bool
self and other values to be equal, and is used by ==.impl Eq for RpcResilienceConfig
impl StructuralPartialEq for RpcResilienceConfig
Auto Trait Implementations§
impl Freeze for RpcResilienceConfig
impl RefUnwindSafe for RpcResilienceConfig
impl Send for RpcResilienceConfig
impl Sync for RpcResilienceConfig
impl Unpin for RpcResilienceConfig
impl UnsafeUnpin for RpcResilienceConfig
impl UnwindSafe for RpcResilienceConfig
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
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
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>
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>
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>
T in a tonic::Request