pub struct BudgetReport { /* private fields */ }Expand description
One budget a session drew on, with its own figures kept apart from the account’s.
Every figure here is a total over requests that really drew on this budget, so the only
way to have one is to add those requests up. Session::budgets is that, and
BudgetReport::record is where a request joins one: the request count, the spend, its
three attributions and the account’s own readings all move together, from the same record,
so a report cannot say it summarises nine requests while its attributions add up to four,
or carry a REST budget’s figures under Budget::Graphql. The fields are read through
the accessors below for exactly the reason RateLimit’s are: a hand-assembled set of
totals would be a measurement of nothing, and this whole accounting exists because a
number nobody measured was argued about instead.
Implementations§
Source§impl BudgetReport
impl BudgetReport
Sourcepub const fn estimated(&self) -> Option<u64>
pub const fn estimated(&self) -> Option<u64>
What a precondition estimated this session would spend against it before it started, when one estimated anything at all.
It is an estimate rather than a measurement, and the report says so where it prints it: what makes it worth carrying is that a reader can see how far the model was from what the session really spent.
Sourcepub const fn attributed(&self) -> u64
pub const fn attributed(&self) -> u64
What this session itself is attributed against it, summed per call.
Attributed rather than spent, for the reason Session::attributed gives: some of
this figure is Basis::Modelled, GitHub’s documented one-point minimum, which is a
lower bound and not a measurement. The four figures below are the same total split by
basis, which is what says how much of it GitHub itself reported.
Sourcepub const fn modelled(&self) -> u64
pub const fn modelled(&self) -> u64
How much of it is this repository’s one-point-per-call lower bound.
Sourcepub const fn counted(&self) -> u64
pub const fn counted(&self) -> u64
How much of it is a count of requests against a budget metered in requests.
Sourcepub const fn not_run(&self) -> usize
pub const fn not_run(&self) -> usize
How many of its requests a rate limiter refused, so they never ran and are attributed nothing.
Sourcepub const fn limit(&self) -> Option<u64>
pub const fn limit(&self) -> Option<u64>
The whole allowance, as GitHub’s own headers reported it.
Sourcepub const fn used_by_the_account(&self) -> Option<u64>
pub const fn used_by_the_account(&self) -> Option<u64>
What the account had spent, as GitHub’s own headers reported it. Not this session’s spend: other work draws on the same budget in the same window.
Sourcepub const fn remaining_first_seen(&self) -> Option<u64>
pub const fn remaining_first_seen(&self) -> Option<u64>
The allowance remaining when this session’s first request against this budget was answered.
Sourcepub const fn remaining_last_seen(&self) -> Option<u64>
pub const fn remaining_last_seen(&self) -> Option<u64>
The allowance remaining when its last one was.
Sourcepub fn account_allowance_fall(&self) -> Option<u64>
pub fn account_allowance_fall(&self) -> Option<u64>
How far the account’s remaining allowance fell while this session ran.
A fall rather than a movement, and the difference is not pedantry: an allowance that rose is the hourly window having reset mid-session, which is not a negative spend and answers zero here. Either way it is not this session’s spend, and the report says so where it prints it — this account is shared, so the difference between two readings of a shared counter measures the account.
Trait Implementations§
Source§impl Clone for BudgetReport
impl Clone for BudgetReport
Source§fn clone(&self) -> BudgetReport
fn clone(&self) -> BudgetReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more