pub struct HaConfig {
pub failover_enabled: bool,
pub failover: Option<FailoverConfig>,
pub rate_limit_threshold: f64,
pub rate_limit_queue_timeout_ms: u64,
pub circuit_breaker_error_threshold: f64,
pub circuit_breaker_half_open_probes: u32,
pub trace_sample_rate: f64,
pub trace_otlp_endpoint: Option<String>,
}Expand description
高可用配置聚合(v7.3.0)
统一驱动故障转移、限流熔断、健康检查、追踪四项高可用能力。
failover_enabled 默认 false,不改变单库行为。
Fields§
§failover_enabled: bool是否启用故障转移(默认 false,单库行为不变)
failover: Option<FailoverConfig>故障转移配置(failover_enabled=false 时为 None)
rate_limit_threshold: f64限流阈值(每秒请求数,0 表示不限)
rate_limit_queue_timeout_ms: u64限流排队超时(毫秒,默认 100)
circuit_breaker_error_threshold: f64熔断错误率阈值 ∈ (0,1),默认 0.5
circuit_breaker_half_open_probes: u32半开探测请求数(≥ 1)
trace_sample_rate: f64追踪采样率 ∈ [0,1]
trace_otlp_endpoint: Option<String>OTLP 导出端点(None 表示不导出)
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HaConfig
impl<'de> Deserialize<'de> for HaConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HaConfig
impl RefUnwindSafe for HaConfig
impl Send for HaConfig
impl Sync for HaConfig
impl Unpin for HaConfig
impl UnsafeUnpin for HaConfig
impl UnwindSafe for HaConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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