Module metrics

Module metrics 

Source
Expand description

§Channel Metrics

This module provides performance monitoring capabilities for IPC channels. It tracks message counts, byte throughput, errors, latency, and queue depth.

§Example

use ipckit::{ChannelMetrics, MeteredChannel};

let channel = NamedPipeChannel::new("my_pipe")?.with_metrics();

// ... use channel ...

let metrics = channel.metrics();
println!("Messages sent: {}", metrics.messages_sent());
println!("Avg latency: {}µs", metrics.avg_latency_us());

// Export for monitoring
log::info!("IPC metrics: {}", metrics.to_json());

Structs§

AggregatedMetrics
Aggregated metrics from multiple channels.
ChannelMetrics
Atomic metrics counters for thread-safe updates.
MeteredReceiver
A receiver wrapper that automatically records metrics.
MeteredSender
A sender wrapper that automatically records metrics.
MeteredWrapper
A wrapper that adds metrics to any channel.
MetricsSnapshot
A snapshot of metrics at a point in time.

Traits§

IntoMetered
Helper trait for creating metered sender/receiver pairs.
MeteredChannel
Trait for channels that support metrics.
WithMetrics
Extension trait for adding metrics to channels.

Functions§

metered_pair
Create a metered channel pair with shared metrics.