pub struct BudgetShares { /* private fields */ }Expand description
The resolved per-pool shares of one process budget.
Implementations§
Sourcepub fn resolve(budget: MemoryBudget, profile: DeployProfile) -> BudgetShares
pub fn resolve(budget: MemoryBudget, profile: DeployProfile) -> BudgetShares
Divide a resolved budget among the pools.
Integer division comes first (budget / 10_000 then * basis_points)
for two reasons: budget * basis_points overflows u64 for budgets
above ~1.8 EiB, and dividing first makes Σ(shares) ≤ budget an identity
rather than a rounding accident. The cost is at most 9_999 bytes of
unallocated remainder per pool.
Sourcepub fn budget_bytes(&self) -> u64
pub fn budget_bytes(&self) -> u64
The budget these shares divide.
Sourcepub fn policy(&self) -> BudgetSharePolicy
pub fn policy(&self) -> BudgetSharePolicy
The policy that produced these shares.
This pool’s slice of the budget.
Σ(shares). Never exceeds Self::budget_bytes.
Sourcepub fn page_cache_slots(&self) -> usize
pub fn page_cache_slots(&self) -> usize
Page-cache slot count: the share divided by the fixed page size.
Clamped to the cache’s structural minimum. A budget small enough to hit
the clamp buys a page cache slightly larger than its share; that is
visible in red.stats as used_bytes > share_bytes and, per ADR 0073
§4, is the enforcement slice’s problem, not this one’s.
Sourcepub fn blob_cache_l1_bytes(&self) -> usize
pub fn blob_cache_l1_bytes(&self) -> usize
Blob Cache L1 byte ceiling: the RAM tier’s share, verbatim.
Trait Implementations§
Source§fn clone(&self) -> BudgetShares
fn clone(&self) -> BudgetShares
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request