pub struct MetricsRegistry {Show 40 fields
pub requests_total: IntCounterVec,
pub requests_duration_seconds: HistogramVec,
pub requests_in_flight: IntGaugeVec,
pub requests_by_path_total: IntCounterVec,
pub request_duration_by_path_seconds: HistogramVec,
pub average_latency_by_path_seconds: GaugeVec,
pub workspace_requests_total: IntCounterVec,
pub workspace_requests_duration_seconds: HistogramVec,
pub workspace_active_routes: IntGaugeVec,
pub workspace_errors_total: IntCounterVec,
pub errors_total: IntCounterVec,
pub error_rate: GaugeVec,
pub plugin_executions_total: IntCounterVec,
pub plugin_execution_duration_seconds: HistogramVec,
pub plugin_errors_total: IntCounterVec,
pub ws_connections_active: IntGauge,
pub ws_connections_total: IntCounter,
pub ws_connection_duration_seconds: HistogramVec,
pub ws_messages_sent: IntCounter,
pub ws_messages_received: IntCounter,
pub ws_errors_total: IntCounter,
pub smtp_connections_active: IntGauge,
pub smtp_connections_total: IntCounter,
pub smtp_messages_received_total: IntCounter,
pub smtp_messages_stored_total: IntCounter,
pub smtp_errors_total: IntCounterVec,
pub mqtt_connections_active: IntGauge,
pub mqtt_connections_total: IntCounter,
pub mqtt_messages_published_total: IntCounter,
pub mqtt_messages_received_total: IntCounter,
pub mqtt_topics_active: IntGauge,
pub mqtt_subscriptions_active: IntGauge,
pub mqtt_retained_messages: IntGauge,
pub mqtt_errors_total: IntCounterVec,
pub memory_usage_bytes: Gauge,
pub cpu_usage_percent: Gauge,
pub thread_count: Gauge,
pub uptime_seconds: Gauge,
pub active_scenario_mode: IntGauge,
pub chaos_triggers_total: IntCounter,
/* private fields */
}
Expand description
Global metrics registry for MockForge
Fields§
§requests_total: IntCounterVec
§requests_duration_seconds: HistogramVec
§requests_in_flight: IntGaugeVec
§requests_by_path_total: IntCounterVec
§request_duration_by_path_seconds: HistogramVec
§average_latency_by_path_seconds: GaugeVec
§workspace_requests_total: IntCounterVec
§workspace_requests_duration_seconds: HistogramVec
§workspace_active_routes: IntGaugeVec
§workspace_errors_total: IntCounterVec
§errors_total: IntCounterVec
§error_rate: GaugeVec
§plugin_executions_total: IntCounterVec
§plugin_execution_duration_seconds: HistogramVec
§plugin_errors_total: IntCounterVec
§ws_connections_active: IntGauge
§ws_connections_total: IntCounter
§ws_connection_duration_seconds: HistogramVec
§ws_messages_sent: IntCounter
§ws_messages_received: IntCounter
§ws_errors_total: IntCounter
§smtp_connections_active: IntGauge
§smtp_connections_total: IntCounter
§smtp_messages_received_total: IntCounter
§smtp_messages_stored_total: IntCounter
§smtp_errors_total: IntCounterVec
§mqtt_connections_active: IntGauge
§mqtt_connections_total: IntCounter
§mqtt_messages_published_total: IntCounter
§mqtt_messages_received_total: IntCounter
§mqtt_topics_active: IntGauge
§mqtt_subscriptions_active: IntGauge
§mqtt_retained_messages: IntGauge
§mqtt_errors_total: IntCounterVec
§memory_usage_bytes: Gauge
§cpu_usage_percent: Gauge
§thread_count: Gauge
§uptime_seconds: Gauge
§active_scenario_mode: IntGauge
§chaos_triggers_total: IntCounter
Implementations§
Source§impl MetricsRegistry
impl MetricsRegistry
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if the registry is initialized
Sourcepub fn record_http_request(
&self,
method: &str,
status: u16,
duration_seconds: f64,
)
pub fn record_http_request( &self, method: &str, status: u16, duration_seconds: f64, )
Record an HTTP request
Sourcepub fn record_grpc_request(
&self,
method: &str,
status: &str,
duration_seconds: f64,
)
pub fn record_grpc_request( &self, method: &str, status: &str, duration_seconds: f64, )
Record a gRPC request
Sourcepub fn record_ws_message_sent(&self)
pub fn record_ws_message_sent(&self)
Record a WebSocket message
Sourcepub fn record_ws_message_received(&self)
pub fn record_ws_message_received(&self)
Record a WebSocket message received
Sourcepub fn record_graphql_request(
&self,
operation: &str,
status: u16,
duration_seconds: f64,
)
pub fn record_graphql_request( &self, operation: &str, status: u16, duration_seconds: f64, )
Record a GraphQL request
Sourcepub fn record_plugin_execution(
&self,
plugin_name: &str,
success: bool,
duration_seconds: f64,
)
pub fn record_plugin_execution( &self, plugin_name: &str, success: bool, duration_seconds: f64, )
Record a plugin execution
Sourcepub fn increment_in_flight(&self, protocol: &str)
pub fn increment_in_flight(&self, protocol: &str)
Increment in-flight requests
Sourcepub fn decrement_in_flight(&self, protocol: &str)
pub fn decrement_in_flight(&self, protocol: &str)
Decrement in-flight requests
Sourcepub fn record_error(&self, protocol: &str, error_type: &str)
pub fn record_error(&self, protocol: &str, error_type: &str)
Record an error
Sourcepub fn update_memory_usage(&self, bytes: f64)
pub fn update_memory_usage(&self, bytes: f64)
Update memory usage
Sourcepub fn update_cpu_usage(&self, percent: f64)
pub fn update_cpu_usage(&self, percent: f64)
Update CPU usage
Sourcepub fn set_scenario_mode(&self, mode: i64)
pub fn set_scenario_mode(&self, mode: i64)
Set active scenario mode (0=healthy, 1=degraded, 2=error, 3=chaos)
Sourcepub fn record_chaos_trigger(&self)
pub fn record_chaos_trigger(&self)
Record a chaos trigger
Sourcepub fn record_http_request_with_path(
&self,
path: &str,
method: &str,
status: u16,
duration_seconds: f64,
)
pub fn record_http_request_with_path( &self, path: &str, method: &str, status: u16, duration_seconds: f64, )
Record an HTTP request with path information
Sourcepub fn record_ws_connection_established(&self)
pub fn record_ws_connection_established(&self)
Record a WebSocket connection established
Sourcepub fn record_ws_connection_closed(&self, duration_seconds: f64, status: &str)
pub fn record_ws_connection_closed(&self, duration_seconds: f64, status: &str)
Record a WebSocket connection closed
Sourcepub fn record_ws_error(&self)
pub fn record_ws_error(&self)
Record a WebSocket error
Sourcepub fn record_smtp_connection_established(&self)
pub fn record_smtp_connection_established(&self)
Record an SMTP connection established
Sourcepub fn record_smtp_connection_closed(&self)
pub fn record_smtp_connection_closed(&self)
Record an SMTP connection closed
Sourcepub fn record_smtp_message_received(&self)
pub fn record_smtp_message_received(&self)
Record an SMTP message received
Sourcepub fn record_smtp_message_stored(&self)
pub fn record_smtp_message_stored(&self)
Record an SMTP message stored
Sourcepub fn record_smtp_error(&self, error_type: &str)
pub fn record_smtp_error(&self, error_type: &str)
Record an SMTP error
Sourcepub fn update_thread_count(&self, count: f64)
pub fn update_thread_count(&self, count: f64)
Update thread count
Sourcepub fn update_uptime(&self, seconds: f64)
pub fn update_uptime(&self, seconds: f64)
Update uptime
Sourcepub fn record_workspace_request(
&self,
workspace_id: &str,
method: &str,
status: u16,
duration_seconds: f64,
)
pub fn record_workspace_request( &self, workspace_id: &str, method: &str, status: u16, duration_seconds: f64, )
Record a workspace request
Sourcepub fn update_workspace_active_routes(&self, workspace_id: &str, count: i64)
pub fn update_workspace_active_routes(&self, workspace_id: &str, count: i64)
Update workspace active routes count
Sourcepub fn record_workspace_error(&self, workspace_id: &str, error_type: &str)
pub fn record_workspace_error(&self, workspace_id: &str, error_type: &str)
Record a workspace error
Sourcepub fn increment_workspace_routes(&self, workspace_id: &str)
pub fn increment_workspace_routes(&self, workspace_id: &str)
Increment workspace active routes
Sourcepub fn decrement_workspace_routes(&self, workspace_id: &str)
pub fn decrement_workspace_routes(&self, workspace_id: &str)
Decrement workspace active routes
Trait Implementations§
Source§impl Clone for MetricsRegistry
impl Clone for MetricsRegistry
Source§fn clone(&self) -> MetricsRegistry
fn clone(&self) -> MetricsRegistry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for MetricsRegistry
impl !RefUnwindSafe for MetricsRegistry
impl Send for MetricsRegistry
impl Sync for MetricsRegistry
impl Unpin for MetricsRegistry
impl !UnwindSafe for MetricsRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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