pub struct Metrics { /* private fields */ }Expand description
All server metrics. Cheap to update (uncontended atomic add), lock-free to render.
Implementations§
Source§impl Metrics
impl Metrics
pub fn new() -> Self
Sourcepub fn record_query(&self, elapsed: Duration, outcome: QueryOutcome)
pub fn record_query(&self, elapsed: Duration, outcome: QueryOutcome)
Record a finished query: its result class and execution time.
Sourcepub fn record_sync_operation(
&self,
operation: SyncOperation,
elapsed: Duration,
outcome: SyncOutcome,
)
pub fn record_sync_operation( &self, operation: SyncOperation, elapsed: Duration, outcome: SyncOutcome, )
Record a completed private sync protocol operation.
pub fn record_sync_pull_payload(&self, units: u64, bytes: u64)
pub fn record_sync_repair_action( &self, operation: SyncOperation, repair: SyncRepairLabel, )
pub fn inc_sync_ack_advanced(&self)
pub fn inc_connection_accepted(&self)
pub fn inc_auth_failure(&self)
Sourcepub fn inc_tx_gate_timeout(&self)
pub fn inc_tx_gate_timeout(&self)
Record an explicit begin that timed out waiting on the transaction
gate. Also counts as a failed query so powdb_queries_total{result= "error"} stays truthful — the client saw the statement fail.
pub fn inc_tls_failure(&self)
Sourcepub fn active_guard(self: &Arc<Self>) -> ActiveGuard
pub fn active_guard(self: &Arc<Self>) -> ActiveGuard
RAII gauge: increments connections_active now, decrements on drop —
correct across every early return or panic in the connection task.
Sourcepub fn in_flight_guard(self: &Arc<Self>) -> InFlightGuard
pub fn in_flight_guard(self: &Arc<Self>) -> InFlightGuard
RAII gauge: increments queries_in_flight now, decrements on drop.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnsafeUnpin for Metrics
impl UnwindSafe for Metrics
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