Skip to main content

InputCounterTracker

Trait InputCounterTracker 

pub trait InputCounterTracker: Extension + Clone {
    // Required methods
    fn concurrent_active_input_count(&self) -> u64;
    fn total_input_count(&self) -> u64;
    fn input_count(&self) -> u64;
}
Expand description

Tracks per input counters and exposes them as an extension.

A tracker is inserted into the input extensions by CountInput for each input that enters the service. The inner service can then read this tracker from extensions to observe total and concurrent counts.

Required Methods§

fn concurrent_active_input_count(&self) -> u64

Live concurrent count of inputs actively being served.

fn total_input_count(&self) -> u64

Total inputs served since creation of the counter that created this tracker.

fn input_count(&self) -> u64

Per input number assigned when this tracker was created.

This is a one based monotonic sequence number.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§