pub struct MetricsContext { /* private fields */ }Expand description
Global metrics context registry (rarely used)
For most use cases, use turbomcp’s ServerMetrics directly. This is provided for backward compatibility and simple metric collection.
Implementations§
Source§impl MetricsContext
impl MetricsContext
Sourcepub fn new(enabled: bool) -> MetricsContext
pub fn new(enabled: bool) -> MetricsContext
Create new metrics context
Sourcepub fn get_counters(&self) -> HashMap<String, u64>
pub fn get_counters(&self) -> HashMap<String, u64>
Get all counter statistics
Sourcepub fn get_histograms(&self) -> HashMap<String, HistogramStats>
pub fn get_histograms(&self) -> HashMap<String, HistogramStats>
Get all histogram statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MetricsContext
impl !RefUnwindSafe for MetricsContext
impl Send for MetricsContext
impl Sync for MetricsContext
impl Unpin for MetricsContext
impl !UnwindSafe for MetricsContext
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