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: u64Bytes 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: u64Bytes the server SERVED: upload-pack, the advertisement, and the archive
stream. Measured by the transport’s own Metered writer.
pushes: u64receive-pack sessions that finished without an error.
fetches: u64upload-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: u64LFS 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: u64LFS object bytes sent. See FlowDay::lfs_bytes_in.
refused_admission: u64Refusal::Admission — the box was full.
refused_cap: u64Refusal::Cap — the plan refused.
refused_policy: u64Refusal::Policy — the push gate refused.
auth_failures: u64A 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: i64The 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: i64The 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: boolThe 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
impl FlowDay
Sourcepub fn refused_for(&self, reason: Refusal) -> u64
pub fn refused_for(&self, reason: Refusal) -> u64
The count for one reason.
Sourcepub fn distinct_principals(&self) -> u64
pub fn distinct_principals(&self) -> u64
Distinct principals seen that day — a floor when
FlowDay::principals_capped.
Sourcepub fn is_empty(&self) -> bool
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.
Sourcepub fn last_seen_unix_ms(&self) -> i64
pub fn last_seen_unix_ms(&self) -> i64
The last time anything moved in either direction, or 0.