pub struct Summary { /* private fields */ }Expand description
Summary 指标,基于排序数组计算分位数。
与 Prometheus Summary 类似,记录所有观测值并按需计算分位数。 适合样本量可控的场景;超大规模样本应考虑 T-Digest 近似算法。
Implementations§
Source§impl Summary
impl Summary
Sourcepub fn new(
name: impl Into<String>,
help: impl Into<String>,
quantiles: Vec<f64>,
) -> Self
pub fn new( name: impl Into<String>, help: impl Into<String>, quantiles: Vec<f64>, ) -> Self
创建新的 Summary 指标
§参数
name:指标名(如request_duration_seconds)help:帮助文本quantiles:要计算的分位数列表(如[0.5, 0.9, 0.99])
Auto Trait Implementations§
impl !RefUnwindSafe for Summary
impl !UnwindSafe for Summary
impl Freeze for Summary
impl Send for Summary
impl Sync for Summary
impl Unpin for Summary
impl UnsafeUnpin for Summary
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