Skip to main content

Registry

Struct Registry 

Source
pub struct Registry { /* private fields */ }

Implementations§

Source§

impl Registry

Source

pub fn record_event(&self, iface: &str, outcome: &str, key_id: &str)

记录一次 auth/trade 事件

Source

pub fn record_limit_reject(&self, iface: &str, key_id: &str, reason_cat: &str)

记录一次限额拒(reason_cat 见文档)

Source

pub fn record_ws_filtered(&self, required_scope: &str, client_key_id: &str)

记录 WS 因 scope 不足被过滤掉的一条推送

Source

pub fn register_renderer<F>(&self, renderer: F)
where F: Fn() -> String + Send + Sync + 'static,

v1.4.90 P1-B: 注册一个 Prometheus extension renderer —— 见 [ExtraRenderer] 文档.

调用方:futu-server / futu-gateway 启动时调一次, 把自己持有的 GatewayMetrics (per-cmd push counter / 24-hour breakdown / push_health circuit breaker 等) 渲染成 Prometheus text 追加到 /metrics.

多次注册会保留所有 renderer; 顺序与注册顺序一致.

Source

pub fn render_prometheus(&self) -> String

Prometheus text exposition 格式输出.

v1.4.106 codex 0542 F1 [P2 SECURITY]: key_id label 默认 redact 为 kh_<8hex> (短 SHA256). 设 FUTU_METRICS_PUBLIC=1 env 回退明文. 见 redact_key_id / Scope::MetricsRead.

Trait Implementations§

Source§

impl Debug for Registry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Registry

Source§

fn default() -> Registry

Returns the “default value” for a type. Read more

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.

§

impl<T> Instrument for T

§

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

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

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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