PrometheusMetrics

Struct PrometheusMetrics 

Source
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: IntGauge

Implementations§

Source§

impl PrometheusMetrics

Source

pub fn new() -> Result<Self, Error>

Create a new metrics instance with all collectors registered.

Source

pub fn encode(&self) -> Result<String, Error>

Encode metrics to Prometheus text format.

Source

pub fn record_rtt(&self, uplink_id: &str, rtt: Duration)

Record an RTT observation.

Source

pub fn record_packet_sent(&self, uplink_id: &str, bytes: u64)

Record packet sent.

Source

pub fn record_packet_received(&self, uplink_id: &str, bytes: u64)

Record packet received.

Source

pub fn record_packet_dropped(&self, uplink_id: &str, reason: &str)

Record packet dropped.

Record uplink state.

Record uplink health.

Record uplink quality metrics.

Source

pub fn set_bandwidth(&self, uplink_id: &str, send_bps: f64, recv_bps: f64)

Record bandwidth.

Source

pub fn record_error(&self, error_type: &str)

Record error.

Source

pub fn record_scheduler_selection( &self, uplink_id: &str, strategy: &str, latency: Duration, )

Record scheduler selection.

Trait Implementations§

Source§

impl Default for PrometheusMetrics

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,