pub struct HostBudget {
pub memory: HostMemory,
pub limit: u64,
pub spare: u64,
pub stalled: bool,
pub credit: Option<HostCredit>,
}Expand description
What the host’s memory leaves the runners (ADR 0055). New runners fit in the lower of MemoryMax and
limit; running ones are never stopped for it.
Fields§
§memory: HostMemoryThe reading it comes from.
limit: u64What the slice may hold now: what its runners hold without page cache plus the host’s MemAvailable, less
a margin kept free for the host’s page cache; with a ceiling, plus what the host can still grow by
(HostMemory::growable, ADR 0084).
spare: u64What that leaves new runners beside what the running ones reserve, in bytes.
stalled: boolWhether the host’s tasks stall for memory (full pressure), so no runner starts until they stop.
credit: Option<HostCredit>What the host’s limit takes off Budget::memory_in_use for runners that may not all grow at once (ADR 0108);
absent while it takes nothing, and from a daemon before 0.0.30.
Implementations§
Source§impl HostBudget
impl HostBudget
Sourcepub fn short_of(&self, needs: u64) -> bool
pub fn short_of(&self, needs: u64) -> bool
Whether the host itself lacks needs bytes for a new runner: its tasks stall, HostMemory::room is less, or
that room is under one more margin, so MemAvailable is under twice the plain margin, the line host::stalls
reads. There a small job fits only by what the host is about to run out of, and what closing programs frees is
what starts it. Otherwise a job the host limit holds waits for what runs, whose reservations reach the limit
(ADR 0103).
Sourcepub fn counts(&self, reserved: u64) -> u64
pub fn counts(&self, reserved: u64) -> u64
What the host’s limit counts of what runs, reserved being Budget::memory_in_use: that less the credit
(ADR 0108).
Sourcepub fn growth_clause(&self, reserved: u64) -> Option<String>
pub fn growth_clause(&self, reserved: u64) -> Option<String>
What that count is made of while a credit stands, as the host’s line, a job’s wait and the log say it: it uses 14G and keeps 9G for growth. None without a credit, when it counts every reservation.
Trait Implementations§
Source§impl Clone for HostBudget
impl Clone for HostBudget
Source§impl Debug for HostBudget
impl Debug for HostBudget
Source§impl<'de> Deserialize<'de> for HostBudget
impl<'de> Deserialize<'de> for HostBudget
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for HostBudget
Source§impl PartialEq for HostBudget
impl PartialEq for HostBudget
Source§impl Serialize for HostBudget
impl Serialize for HostBudget
impl StructuralPartialEq for HostBudget
Auto Trait Implementations§
impl Forget for HostBudget
impl Freeze for HostBudget
impl RefUnwindSafe for HostBudget
impl Send for HostBudget
impl Sync for HostBudget
impl Unpin for HostBudget
impl UnsafeUnpin for HostBudget
impl UnwindSafe for HostBudget
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.