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
impl ServerMetrics
Sourcepub fn add_connections_opened(&self, n: u64)
pub fn add_connections_opened(&self, n: u64)
Add n to connections_opened.
Sourcepub fn add_connections_accepted(&self, n: u64)
pub fn add_connections_accepted(&self, n: u64)
Add n to connections_accepted.
Sourcepub fn add_connections_anonymous(&self, n: u64)
pub fn add_connections_anonymous(&self, n: u64)
Add n to connections_anonymous.
Sourcepub fn add_connections_refused(&self, n: u64)
pub fn add_connections_refused(&self, n: u64)
Add n to connections_refused.
Sourcepub fn add_auth_faults(&self, n: u64)
pub fn add_auth_faults(&self, n: u64)
Add n to auth_faults.
Sourcepub fn add_exec_refused(&self, n: u64)
pub fn add_exec_refused(&self, n: u64)
Add n to exec_refused.
Sourcepub fn add_transfers_started(&self, n: u64)
pub fn add_transfers_started(&self, n: u64)
Add n to transfers_started.
Sourcepub fn add_transfers_in_flight(&self, n: u64)
pub fn add_transfers_in_flight(&self, n: u64)
Add n to transfers_in_flight.
Sourcepub fn add_transfers_failed(&self, n: u64)
pub fn add_transfers_failed(&self, n: u64)
Add n to transfers_failed.
Sourcepub fn add_packs_served(&self, n: u64)
pub fn add_packs_served(&self, n: u64)
Add n to packs_served.
Sourcepub fn add_objects_sent(&self, n: u64)
pub fn add_objects_sent(&self, n: u64)
Add n to objects_sent.
Sourcepub fn add_bytes_out(&self, n: u64)
pub fn add_bytes_out(&self, n: u64)
Add n to bytes_out.
Sourcepub fn add_bytes_in(&self, n: u64)
pub fn add_bytes_in(&self, n: u64)
Add n to bytes_in.
Sourcepub fn add_pushes_accepted(&self, n: u64)
pub fn add_pushes_accepted(&self, n: u64)
Add n to pushes_accepted.
Sourcepub fn add_pushes_rejected(&self, n: u64)
pub fn add_pushes_rejected(&self, n: u64)
Add n to pushes_rejected.
Sourcepub fn add_refs_updated(&self, n: u64)
pub fn add_refs_updated(&self, n: u64)
Add n to refs_updated.
Sourcepub fn add_refs_deleted(&self, n: u64)
pub fn add_refs_deleted(&self, n: u64)
Add n to refs_deleted.
Sourcepub fn add_refs_rejected(&self, n: u64)
pub fn add_refs_rejected(&self, n: u64)
Add n to refs_rejected.
Sourcepub fn add_gate_refusals(&self, n: u64)
pub fn add_gate_refusals(&self, n: u64)
Add n to gate_refusals.
Sourcepub fn add_usage_reconcile_missed(&self, n: u64)
pub fn add_usage_reconcile_missed(&self, n: u64)
Add n to usage_reconcile_missed.
Sourcepub fn snapshot(&self) -> MetricsSnapshot
pub fn snapshot(&self) -> MetricsSnapshot
Read every counter.
Source§impl ServerMetrics
impl ServerMetrics
Sourcepub fn new() -> ServerMetrics
pub fn new() -> ServerMetrics
A fresh set of counters, all zero.
Sourcepub fn transfer_started(self: &Arc<ServerMetrics>) -> InFlightGuard
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.