tuwunel_admin/debug/state_local_metrics.rs
1use tuwunel_core::Result;
2
3use crate::admin_command;
4
5#[admin_command]
6/// Print process-lifetime local state-build counters.
7///
8/// Difference two snapshots to observe activity over an interval.
9pub(super) async fn state_local_metrics(&self) -> Result {
10 let metrics = self.services.event_handler.state_local_metrics();
11 let out = format!(
12 "State-local build counters are process-lifetime totals. Two snapshots should be \
13 differenced to obtain an interval.\n\n```rs\n{metrics:#?}\n```"
14 );
15
16 self.write_str(&out).await
17}