pub struct Registry { /* private fields */ }Implementations§
Source§impl Registry
impl Registry
Sourcepub fn record_event(&self, iface: &str, outcome: &str, key_id: &str)
pub fn record_event(&self, iface: &str, outcome: &str, key_id: &str)
记录一次 auth/trade 事件
Sourcepub fn record_limit_reject(&self, iface: &str, key_id: &str, reason_cat: &str)
pub fn record_limit_reject(&self, iface: &str, key_id: &str, reason_cat: &str)
记录一次限额拒(reason_cat 见文档)
Sourcepub fn record_ws_filtered(&self, required_scope: &str, client_key_id: &str)
pub fn record_ws_filtered(&self, required_scope: &str, client_key_id: &str)
记录 WS 因 scope 不足被过滤掉的一条推送
Sourcepub fn register_renderer<F>(&self, renderer: F)
pub fn register_renderer<F>(&self, renderer: F)
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; 顺序与注册顺序一致.
Sourcepub fn render_prometheus(&self) -> String
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§
Auto Trait Implementations§
impl !Freeze for Registry
impl !RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl !UnwindSafe for Registry
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