pub struct PluginMetrics { /* private fields */ }Expand description
Plugin metrics collector
Implementations§
Source§impl PluginMetrics
impl PluginMetrics
Sourcepub fn record_hook_call(
&self,
plugin_name: &str,
hook: HookType,
latency: Duration,
success: bool,
)
pub fn record_hook_call( &self, plugin_name: &str, hook: HookType, latency: Duration, success: bool, )
Record a hook call
Sourcepub fn record_plugin_load(&self, plugin_name: &str)
pub fn record_plugin_load(&self, plugin_name: &str)
Record a plugin load
Sourcepub fn record_plugin_unload(&self, plugin_name: &str)
pub fn record_plugin_unload(&self, plugin_name: &str)
Record a plugin unload
Sourcepub fn record_plugin_error(&self, plugin_name: &str, _error: &str)
pub fn record_plugin_error(&self, plugin_name: &str, _error: &str)
Record a plugin error
Sourcepub fn get_plugin_stats(&self, plugin_name: &str) -> PluginStats
pub fn get_plugin_stats(&self, plugin_name: &str) -> PluginStats
Get plugin statistics
Sourcepub fn get_all_stats(&self) -> HashMap<String, PluginStats>
pub fn get_all_stats(&self) -> HashMap<String, PluginStats>
Get all plugin statistics
Sourcepub fn total_calls(&self) -> u64
pub fn total_calls(&self) -> u64
Get total calls
Sourcepub fn total_errors(&self) -> u64
pub fn total_errors(&self) -> u64
Get total errors
Sourcepub fn avg_latency(&self) -> Duration
pub fn avg_latency(&self) -> Duration
Get average latency across all plugins
Sourcepub fn get_hook_latency(&self, hook: HookType) -> HookLatency
pub fn get_hook_latency(&self, hook: HookType) -> HookLatency
Get hook latency
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PluginMetrics
impl !RefUnwindSafe for PluginMetrics
impl Send for PluginMetrics
impl Sync for PluginMetrics
impl Unpin for PluginMetrics
impl UnsafeUnpin for PluginMetrics
impl UnwindSafe for PluginMetrics
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more