pub struct Metrics {
pub registry: Registry,
/* private fields */
}Fields§
§registry: RegistryImplementations§
Source§impl Metrics
impl Metrics
pub fn new() -> Self
Sourcepub fn record_request(&self, kind: RequestKind, result: Status, repo: &str)
pub fn record_request(&self, kind: RequestKind, result: Status, repo: &str)
Record the outcome of a client request. repo is the served repo path on
success and - on any failure, so unbounded client-supplied paths cannot
inflate label cardinality.
Sourcepub fn record_upstream(&self, op: UpstreamOp, result: Status, repo: &str)
pub fn record_upstream(&self, op: UpstreamOp, result: Status, repo: &str)
Record an upstream clone/fetch. Errors are recorded too (Status::Error);
pass the repo path on success and - on error, matching record_request.
Sourcepub fn set_cache_size(&self, bytes: u64, mirrors: usize)
pub fn set_cache_size(&self, bytes: u64, mirrors: usize)
Refresh the cache-size gauges from the eviction index.
Sourcepub fn record_eviction(&self)
pub fn record_eviction(&self)
Record one evicted mirror.
Sourcepub fn record_lfs(&self, result: LfsResult)
pub fn record_lfs(&self, result: LfsResult)
Record a cached LFS object lookup (hit / miss / error).
Sourcepub fn observe_upstream(&self, op: UpstreamOp, repo: &str, seconds: f64)
pub fn observe_upstream(&self, op: UpstreamOp, repo: &str, seconds: f64)
Observe an upstream op’s duration. Call only on success with the real repo,
matching the counters’ bounded-repo cardinality discipline.
Sourcepub fn observe_serve(&self, kind: ServeKind, repo: &str, seconds: f64)
pub fn observe_serve(&self, kind: ServeKind, repo: &str, seconds: f64)
Observe a client serve duration, same cardinality discipline as
observe_upstream.
pub fn gather(&self) -> String
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Metrics
impl !UnwindSafe for Metrics
impl Freeze for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnsafeUnpin 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