Skip to main content

ConnectionMetricsSource

Struct ConnectionMetricsSource 

Source
pub struct ConnectionMetricsSource { /* private fields */ }
Expand description

按后端冻结槽目录的原子等待指标源,Prometheus 与 OTLP 共享同一快照与系列边界。

Implementations§

Source§

impl ConnectionMetricsSource

Source

pub fn new(driver: DatabaseDriver) -> Self

业务作用:在指标源注册前冻结指定后端的槽目录,后续注册不扩大已预留的系列预算。

参数说明:

  • driver:限定该源拥有的已登记槽及固定未知身份槽。

返回:不创建后台 worker 的指标源;原子值持续更新,目录不再变化。

Source

pub fn series_budget(&self) -> usize

业务作用:计算当前冻结 datasource 目录的最坏 Prometheus 系列预算。

参数说明:无。

返回:包含固定未知身份和全部 counter、gauge、桶、sum、count 的系列数。

Trait Implementations§

Source§

impl LegacyMetricsSource for ConnectionMetricsSource

Source§

fn descriptors(&self) -> &'static [&'static MetricDescriptor]

业务作用:发布等待与门禁族的统一描述符。

参数说明:无。

返回:固定且与结构化快照一致的目录。

Source§

fn snapshot(&self) -> Option<Vec<MetricSample>>

业务作用:在出口侧读取原子单元并构造低基数样本。

参数说明:无。

返回:冻结目录内的实时 counter、gauge 和非累积 Histogram 快照,不包含源创建后登记的槽。

Source§

fn render_prometheus(&self, _output: &mut String)

业务作用:由 MetricHub 统一渲染结构化快照,避免重复文本系列。

参数说明:

  • _output:为兼容文本缓冲区。

返回:无;该源不使用旧文本回退路径。

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more