pub struct BudgetProjection { /* private fields */ }Expand description
What a host’s configured target set will cost per hour, and whether that fits.
f1’s host show renders BudgetProjection::requests_per_hour,
BudgetProjection::headroom and
BudgetProjection::max_repository_targets; f2’s repo add and org add
call BudgetProjection::admit and refuse on
Admission::Refused. g3 shows the same numbers in the TUI. All four read
one model, which is the only way the CLI and the TUI can agree about why an
eleventh repository was refused.
Implementations§
Source§impl BudgetProjection
impl BudgetProjection
pub fn new( interval: RefreshInterval, targets: impl IntoIterator<Item = TargetCost>, ) -> Self
pub fn interval(&self) -> RefreshInterval
pub fn targets(&self) -> &[TargetCost]
pub fn refreshes_per_hour(&self) -> u32
Sourcepub fn requests_per_hour(&self) -> u32
pub fn requests_per_hour(&self) -> u32
The projected hourly request count for the whole target set.
pub fn ceiling(&self) -> u32
pub fn allowance(&self) -> u32
pub fn exceeds_allowance(&self) -> bool
Sourcepub fn max_repository_targets(interval: RefreshInterval) -> u32
pub fn max_repository_targets(interval: RefreshInterval) -> u32
How many repository targets one host can serve at interval.
04-subsystem-contracts.md states the answer as “roughly 10 targets per
host at the 60-second default and 5 at the 30-second floor”, and this
reproduces both. It is stated in repository targets because that is the
only target whose cost is a constant; an organization’s depends on its
installed repository count, so “how many organizations fit” has no single
answer and this deliberately does not invent one.
Sourcepub fn admit(&self, candidate: TargetCost) -> Admission
pub fn admit(&self, candidate: TargetCost) -> Admission
Whether one more target fits.
Trait Implementations§
Source§impl Clone for BudgetProjection
impl Clone for BudgetProjection
Source§fn clone(&self) -> BudgetProjection
fn clone(&self) -> BudgetProjection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BudgetProjection
impl Debug for BudgetProjection
impl Eq for BudgetProjection
Source§impl PartialEq for BudgetProjection
impl PartialEq for BudgetProjection
impl StructuralPartialEq for BudgetProjection
Auto Trait Implementations§
impl Freeze for BudgetProjection
impl RefUnwindSafe for BudgetProjection
impl Send for BudgetProjection
impl Sync for BudgetProjection
impl Unpin for BudgetProjection
impl UnsafeUnpin for BudgetProjection
impl UnwindSafe for BudgetProjection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.