pub struct PrometheusMetrics {Show 37 fields
pub connections_total: IntCounter,
pub connections_active: IntGauge,
pub connections_by_user: IntGaugeVec,
pub sessions_total: IntCounter,
pub sessions_active: IntGauge,
pub session_duration_seconds: Histogram,
pub uplinks_total: IntGauge,
pub uplinks_active: IntGauge,
pub uplink_state: IntGaugeVec,
pub uplink_health: GaugeVec,
pub bytes_sent_total: IntCounterVec,
pub bytes_received_total: IntCounterVec,
pub packets_sent_total: IntCounterVec,
pub packets_received_total: IntCounterVec,
pub packets_dropped_total: IntCounterVec,
pub packets_retransmitted_total: IntCounterVec,
pub rtt_seconds: GaugeVec,
pub rtt_histogram: HistogramVec,
pub jitter_seconds: GaugeVec,
pub packet_loss_ratio: GaugeVec,
pub quality_score: GaugeVec,
pub bandwidth_bytes_per_sec: GaugeVec,
pub nat_type: IntGaugeVec,
pub external_port: IntGaugeVec,
pub active_flows: IntGauge,
pub flow_bindings: IntGaugeVec,
pub scheduler_selections_total: IntCounterVec,
pub scheduler_latency_seconds: Histogram,
pub handshakes_total: IntCounter,
pub handshakes_failed: IntCounter,
pub rekeys_total: IntCounter,
pub encrypt_operations: IntCounter,
pub decrypt_operations: IntCounter,
pub errors_total: IntCounterVec,
pub server_uptime_seconds: Gauge,
pub users_total: IntGauge,
pub users_active: IntGauge,
/* private fields */
}Expand description
Prometheus metrics registry and collectors.
Fields§
§connections_total: IntCounter§connections_active: IntGauge§connections_by_user: IntGaugeVec§sessions_total: IntCounter§sessions_active: IntGauge§session_duration_seconds: Histogram§uplinks_total: IntGauge§uplinks_active: IntGauge§uplink_state: IntGaugeVec§uplink_health: GaugeVec§bytes_sent_total: IntCounterVec§bytes_received_total: IntCounterVec§packets_sent_total: IntCounterVec§packets_received_total: IntCounterVec§packets_dropped_total: IntCounterVec§packets_retransmitted_total: IntCounterVec§rtt_seconds: GaugeVec§rtt_histogram: HistogramVec§jitter_seconds: GaugeVec§packet_loss_ratio: GaugeVec§quality_score: GaugeVec§bandwidth_bytes_per_sec: GaugeVec§nat_type: IntGaugeVec§external_port: IntGaugeVec§active_flows: IntGauge§flow_bindings: IntGaugeVec§scheduler_selections_total: IntCounterVec§scheduler_latency_seconds: Histogram§handshakes_total: IntCounter§handshakes_failed: IntCounter§rekeys_total: IntCounter§encrypt_operations: IntCounter§decrypt_operations: IntCounter§errors_total: IntCounterVec§server_uptime_seconds: Gauge§users_total: IntGauge§users_active: IntGaugeImplementations§
Source§impl PrometheusMetrics
impl PrometheusMetrics
Sourcepub fn new() -> Result<Self, Error>
pub fn new() -> Result<Self, Error>
Create a new metrics instance with all collectors registered.
Sourcepub fn record_rtt(&self, uplink_id: &str, rtt: Duration)
pub fn record_rtt(&self, uplink_id: &str, rtt: Duration)
Record an RTT observation.
Sourcepub fn record_packet_sent(&self, uplink_id: &str, bytes: u64)
pub fn record_packet_sent(&self, uplink_id: &str, bytes: u64)
Record packet sent.
Sourcepub fn record_packet_received(&self, uplink_id: &str, bytes: u64)
pub fn record_packet_received(&self, uplink_id: &str, bytes: u64)
Record packet received.
Sourcepub fn record_packet_dropped(&self, uplink_id: &str, reason: &str)
pub fn record_packet_dropped(&self, uplink_id: &str, reason: &str)
Record packet dropped.
Sourcepub fn set_uplink_state(&self, uplink_id: &str, interface: &str, state: i64)
pub fn set_uplink_state(&self, uplink_id: &str, interface: &str, state: i64)
Record uplink state.
Sourcepub fn set_uplink_health(&self, uplink_id: &str, interface: &str, health: f64)
pub fn set_uplink_health(&self, uplink_id: &str, interface: &str, health: f64)
Record uplink health.
Sourcepub fn set_uplink_quality(
&self,
uplink_id: &str,
loss: f64,
score: f64,
jitter_secs: f64,
)
pub fn set_uplink_quality( &self, uplink_id: &str, loss: f64, score: f64, jitter_secs: f64, )
Record uplink quality metrics.
Sourcepub fn set_bandwidth(&self, uplink_id: &str, send_bps: f64, recv_bps: f64)
pub fn set_bandwidth(&self, uplink_id: &str, send_bps: f64, recv_bps: f64)
Record bandwidth.
Sourcepub fn record_error(&self, error_type: &str)
pub fn record_error(&self, error_type: &str)
Record error.
Sourcepub fn record_scheduler_selection(
&self,
uplink_id: &str,
strategy: &str,
latency: Duration,
)
pub fn record_scheduler_selection( &self, uplink_id: &str, strategy: &str, latency: Duration, )
Record scheduler selection.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrometheusMetrics
impl !RefUnwindSafe for PrometheusMetrics
impl Send for PrometheusMetrics
impl Sync for PrometheusMetrics
impl Unpin for PrometheusMetrics
impl !UnwindSafe for PrometheusMetrics
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