Skip to main content

FlowDay

Struct FlowDay 

Source
pub struct FlowDay {
Show 14 fields pub bytes_in: u64, pub bytes_out: u64, pub pushes: u64, pub fetches: u64, pub lfs_bytes_in: u64, pub lfs_bytes_out: u64, pub refused_admission: u64, pub refused_cap: u64, pub refused_policy: u64, pub auth_failures: u64, pub last_push_unix_ms: i64, pub last_fetch_unix_ms: i64, pub principals: BTreeSet<String>, pub principals_capped: bool,
}
Expand description

One namespace’s flow for one UTC day.

Every field is a count of something that HAPPENED. There is no field here whose absence could be mistaken for a reading that was never taken: a day with no row is a day with no traffic, and a row of zeroes is the same thing said twice. That is the opposite of the stock meters, where a missing reading and a zero mean different things — and the difference is that a transfer either occurred or did not.

Fields§

§bytes_in: u64

Bytes the server ACCEPTED off the wire: receive-pack, and the client half of every other conversation. Measured by the transport’s own Metered reader, which is the one place a byte arriving is counted.

§bytes_out: u64

Bytes the server SERVED: upload-pack, the advertisement, and the archive stream. Measured by the transport’s own Metered writer.

§pushes: u64

receive-pack sessions that finished without an error.

§fetches: u64

upload-pack sessions, clones included. The bare advertisement (GET /info/refs, git ls-remote) is NOT one: it reads the ref list and asks for no objects, and counting it would make a monitoring probe look like a customer.

§lfs_bytes_in: u64

LFS object bytes received. A subset of nothing: LFS rides its own conversation, so these bytes are also in FlowDay::bytes_in as wire bytes, and this is the applied figure the session itself counted.

§lfs_bytes_out: u64

LFS object bytes sent. See FlowDay::lfs_bytes_in.

§refused_admission: u64

Refusal::Admission — the box was full.

§refused_cap: u64

Refusal::Cap — the plan refused.

§refused_policy: u64

Refusal::Policy — the push gate refused.

§auth_failures: u64

A principal that authenticated and then held no grant here. See the module doc for the half that is deliberately absent: a key that resolves to nobody names no namespace and is not a tenant’s number.

§last_push_unix_ms: i64

The last transfer that put bytes IN, in Unix milliseconds; 0 for a day with no push. Kept per day rather than only in the latest row so a series answers when in that week did they stop and not only have they stopped.

§last_fetch_unix_ms: i64

The last transfer that took bytes OUT. 0 for a day with no fetch.

§principals: BTreeSet<String>

Which principals were seen, by the fingerprint the auth table knows them as. Exact, bounded by PRINCIPAL_CEILING; see there for why a set and not a sketch.

§principals_capped: bool

The principal set stopped growing at PRINCIPAL_CEILING, so principals.len() is a FLOOR and not a total. It has never been true on any real namespace; it exists so that if it ever is, the number says so instead of quietly flattening.

Implementations§

Source§

impl FlowDay

Source

pub fn refused(&self) -> u64

Every refusal, whatever the reason.

Source

pub fn refused_for(&self, reason: Refusal) -> u64

The count for one reason.

Source

pub fn distinct_principals(&self) -> u64

Distinct principals seen that day — a floor when FlowDay::principals_capped.

Source

pub fn is_empty(&self) -> bool

Nothing happened: no bytes, no sessions, no refusals, nobody seen. A row like this is never written — a day with no traffic has no row — and this is what the flush asks before writing one.

Source

pub fn last_seen_unix_ms(&self) -> i64

The last time anything moved in either direction, or 0.

Source

pub fn add(&mut self, other: &FlowDay)

Add other into this day. Used to fold a series into a window total, never by the flush — see the module doc for why the flush copies rather than adds.

Trait Implementations§

Source§

impl Clone for FlowDay

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FlowDay

Source§

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

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

impl Default for FlowDay

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for FlowDay

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for FlowDay

Source§

impl PartialEq for FlowDay

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for FlowDay

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FlowDay

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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