pub struct MetricsRegistry {Show 53 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,
pub service_availability: GaugeVec,
pub slo_compliance: GaugeVec,
pub successful_request_rate: GaugeVec,
pub p95_latency_slo_compliance: GaugeVec,
pub error_budget_remaining: GaugeVec,
pub marketplace_publish_total: IntCounterVec,
pub marketplace_publish_duration_seconds: HistogramVec,
pub marketplace_download_total: IntCounterVec,
pub marketplace_download_duration_seconds: HistogramVec,
pub marketplace_search_total: IntCounterVec,
pub marketplace_search_duration_seconds: HistogramVec,
pub marketplace_errors_total: IntCounterVec,
pub marketplace_items_total: IntGaugeVec,
/* 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§service_availability: GaugeVec§slo_compliance: GaugeVec§successful_request_rate: GaugeVec§p95_latency_slo_compliance: GaugeVec§error_budget_remaining: GaugeVec§marketplace_publish_total: IntCounterVec§marketplace_publish_duration_seconds: HistogramVec§marketplace_download_total: IntCounterVec§marketplace_download_duration_seconds: HistogramVec§marketplace_search_total: IntCounterVec§marketplace_search_duration_seconds: HistogramVec§marketplace_errors_total: IntCounterVec§marketplace_items_total: IntGaugeVecImplementations§
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_http_request_with_pillar(
&self,
method: &str,
status: u16,
duration_seconds: f64,
pillar: &str,
)
pub fn record_http_request_with_pillar( &self, method: &str, status: u16, duration_seconds: f64, pillar: &str, )
Record an HTTP request with pillar information
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_grpc_request_with_pillar(
&self,
method: &str,
status: &str,
duration_seconds: f64,
pillar: &str,
)
pub fn record_grpc_request_with_pillar( &self, method: &str, status: &str, duration_seconds: f64, pillar: &str, )
Record a gRPC request with pillar information
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 record_error_with_pillar(
&self,
protocol: &str,
error_type: &str,
pillar: &str,
)
pub fn record_error_with_pillar( &self, protocol: &str, error_type: &str, pillar: &str, )
Record an error with pillar information
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_http_request_with_path_and_pillar(
&self,
path: &str,
method: &str,
status: u16,
duration_seconds: f64,
pillar: &str,
)
pub fn record_http_request_with_path_and_pillar( &self, path: &str, method: &str, status: u16, duration_seconds: f64, pillar: &str, )
Record an HTTP request with path and pillar 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
Sourcepub fn record_marketplace_publish(
&self,
item_type: &str,
success: bool,
duration_seconds: f64,
)
pub fn record_marketplace_publish( &self, item_type: &str, success: bool, duration_seconds: f64, )
Record a marketplace publish operation
Sourcepub fn record_marketplace_download(
&self,
item_type: &str,
success: bool,
duration_seconds: f64,
)
pub fn record_marketplace_download( &self, item_type: &str, success: bool, duration_seconds: f64, )
Record a marketplace download operation
Sourcepub fn record_marketplace_search(
&self,
item_type: &str,
success: bool,
duration_seconds: f64,
)
pub fn record_marketplace_search( &self, item_type: &str, success: bool, duration_seconds: f64, )
Record a marketplace search operation
Sourcepub fn record_marketplace_error(&self, item_type: &str, error_code: &str)
pub fn record_marketplace_error(&self, item_type: &str, error_code: &str)
Record a marketplace error
Sourcepub fn update_marketplace_items_total(&self, item_type: &str, count: i64)
pub fn update_marketplace_items_total(&self, item_type: &str, count: i64)
Update the total number of marketplace items
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 more