Skip to main content

ServerMetrics

Struct ServerMetrics 

Source
pub struct ServerMetrics { /* private fields */ }
Expand description

Everything an operator watches, as one flat block of atomics.

Held behind an Arc and shared by the SSH listener and the git transport, which is what makes “connections refused” and “pushes rejected” numbers about the same server rather than two crates’ private tallies.

Every method is one fetch_add(Relaxed). There is no lock anywhere in this type, and ServerMetrics::snapshot reads the fields independently rather than under a barrier: these are a signal, and a signal read atomically across eighteen fields would cost more than it tells anyone.

Implementations§

Source§

impl ServerMetrics

Source

pub fn add_connections_opened(&self, n: u64)

Add n to connections_opened.

Source

pub fn add_connections_accepted(&self, n: u64)

Add n to connections_accepted.

Source

pub fn add_connections_anonymous(&self, n: u64)

Add n to connections_anonymous.

Source

pub fn add_connections_refused(&self, n: u64)

Add n to connections_refused.

Source

pub fn add_auth_faults(&self, n: u64)

Add n to auth_faults.

Source

pub fn add_exec_refused(&self, n: u64)

Add n to exec_refused.

Source

pub fn add_transfers_started(&self, n: u64)

Add n to transfers_started.

Source

pub fn add_transfers_in_flight(&self, n: u64)

Add n to transfers_in_flight.

Source

pub fn add_transfers_failed(&self, n: u64)

Add n to transfers_failed.

Source

pub fn add_packs_served(&self, n: u64)

Add n to packs_served.

Source

pub fn add_objects_sent(&self, n: u64)

Add n to objects_sent.

Source

pub fn add_bytes_out(&self, n: u64)

Add n to bytes_out.

Source

pub fn add_bytes_in(&self, n: u64)

Add n to bytes_in.

Source

pub fn add_pushes_accepted(&self, n: u64)

Add n to pushes_accepted.

Source

pub fn add_pushes_rejected(&self, n: u64)

Add n to pushes_rejected.

Source

pub fn add_refs_updated(&self, n: u64)

Add n to refs_updated.

Source

pub fn add_refs_deleted(&self, n: u64)

Add n to refs_deleted.

Source

pub fn add_refs_rejected(&self, n: u64)

Add n to refs_rejected.

Source

pub fn add_gate_refusals(&self, n: u64)

Add n to gate_refusals.

Source

pub fn add_usage_reconcile_missed(&self, n: u64)

Add n to usage_reconcile_missed.

Source

pub fn snapshot(&self) -> MetricsSnapshot

Read every counter.

Source§

impl ServerMetrics

Source

pub fn new() -> ServerMetrics

A fresh set of counters, all zero.

Source

pub fn transfer_started(self: &Arc<ServerMetrics>) -> InFlightGuard

A transfer began. Returns a guard whose Drop decrements transfers_in_flight, so the gauge cannot be leaked by an error path that forgot to close it, the failure mode that turns a working gauge into a server that appears permanently busy.

Trait Implementations§

Source§

impl Debug for ServerMetrics

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for ServerMetrics

Source§

fn default() -> ServerMetrics

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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<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