pub struct Session { /* private fields */ }Expand description
One session’s requests, as a value a caller can hold, compare and report on.
Implementations§
Source§impl Session
impl Session
Sourcepub fn total_requests(&self) -> usize
pub fn total_requests(&self) -> usize
How many requests this session sent.
Sourcepub fn total_node_count(&self) -> u64
pub fn total_node_count(&self) -> u64
The nodes every GraphQL request that has a node count may return, added up.
Sourcepub fn estimated(&self, budget: Budget) -> Option<u64>
pub fn estimated(&self, budget: Budget) -> Option<u64>
What a precondition estimated this session would spend against budget, before it
started, when one estimated anything at all.
Sourcepub fn attributed(&self, budget: Budget) -> u64
pub fn attributed(&self, budget: Budget) -> u64
What this session is attributed against budget, summed per call.
Attributed rather than spent, and the difference is the point: only a call GitHub
itself reported a cost for is a measurement. A call against a budget metered in
requests is its own measure, and every other GraphQL call carries Basis::Modelled
— one point, GitHub’s documented minimum, which is a lower bound. So this is what
the session can account for, never a claim about what GitHub charged; Self::budgets
is where the same total comes apart by basis, and that is what says how much of it is
measured.
Sourcepub fn budgets(&self) -> Vec<BudgetReport>
pub fn budgets(&self) -> Vec<BudgetReport>
Every budget this session touched, in a stable order.