pub struct ConnectionMetricsSource { /* private fields */ }Expand description
按后端冻结槽目录的原子等待指标源,Prometheus 与 OTLP 共享同一快照与系列边界。
Implementations§
Source§impl ConnectionMetricsSource
impl ConnectionMetricsSource
Sourcepub fn new(driver: DatabaseDriver) -> Self
pub fn new(driver: DatabaseDriver) -> Self
业务作用:在指标源注册前冻结指定后端的槽目录,后续注册不扩大已预留的系列预算。
参数说明:
driver:限定该源拥有的已登记槽及固定未知身份槽。
返回:不创建后台 worker 的指标源;原子值持续更新,目录不再变化。
Sourcepub fn series_budget(&self) -> usize
pub fn series_budget(&self) -> usize
业务作用:计算当前冻结 datasource 目录的最坏 Prometheus 系列预算。
参数说明:无。
返回:包含固定未知身份和全部 counter、gauge、桶、sum、count 的系列数。
Trait Implementations§
Source§impl LegacyMetricsSource for ConnectionMetricsSource
impl LegacyMetricsSource for ConnectionMetricsSource
Source§fn descriptors(&self) -> &'static [&'static MetricDescriptor]
fn descriptors(&self) -> &'static [&'static MetricDescriptor]
业务作用:发布等待与门禁族的统一描述符。
参数说明:无。
返回:固定且与结构化快照一致的目录。
Source§fn snapshot(&self) -> Option<Vec<MetricSample>>
fn snapshot(&self) -> Option<Vec<MetricSample>>
业务作用:在出口侧读取原子单元并构造低基数样本。
参数说明:无。
返回:冻结目录内的实时 counter、gauge 和非累积 Histogram 快照,不包含源创建后登记的槽。
Source§fn render_prometheus(&self, _output: &mut String)
fn render_prometheus(&self, _output: &mut String)
业务作用:由 MetricHub 统一渲染结构化快照,避免重复文本系列。
参数说明:
_output:为兼容文本缓冲区。
返回:无;该源不使用旧文本回退路径。
Auto Trait Implementations§
impl Forget for ConnectionMetricsSource
impl Freeze for ConnectionMetricsSource
impl Move for ConnectionMetricsSource
impl RefUnwindSafe for ConnectionMetricsSource
impl Send for ConnectionMetricsSource
impl Sync for ConnectionMetricsSource
impl Unpin for ConnectionMetricsSource
impl UnsafeUnpin for ConnectionMetricsSource
impl UnwindSafe for ConnectionMetricsSource
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