pub struct Budget {Show 13 fields
pub slice: String,
pub memory_max: Option<u64>,
pub memory_in_use: u64,
pub pooled: Option<Pooled>,
pub counted: Option<Counted>,
pub admission: AdmissionPolicy,
pub held: bool,
pub mirror_memory: u64,
pub seed_memory: Vec<SeedMemory>,
pub shell_memory: Vec<ShellMemory>,
pub host: Option<HostBudget>,
pub cpu: Option<CpuBudget>,
pub slice_cpus: Option<u64>,
}Expand description
The memory budget runners and the mirror share, in bytes.
Fields§
§slice: StringThe systemd slice runner containers run in.
memory_max: Option<u64>The slice’s MemoryMax; None when it is unlimited.
memory_in_use: u64Memory the running containers reserve: the runners’ caps, or under measured admission the larger of each runner’s predicted peak and its last sampled memory, nothing for one whose container is gone, and the caps of the seed containers, shells and the mirror.
pooled: Option<Pooled>What pooling takes off memory_in_use (ADR 0099, 0130); absent while it takes nothing.
counted: Option<Counted>The growth count both budgets go by, and its brake (ADR 0130); pooled and host.credit say what it takes off
memory_in_use. Absent under caps admission, with [host] pooled_count off, and from an older daemon.
admission: AdmissionPolicyWhat a new runner must fit in beside them.
held: boolUnder measured admission, whether the slice is at the high-water mark, so no runner starts.
mirror_memory: u64The mirror’s part of memory_in_use: its cap while it is enabled or still running, else 0.
seed_memory: Vec<SeedMemory>The seed containers’ part of memory_in_use, one per profile that reseeds, by profile name.
shell_memory: Vec<ShellMemory>The shells’ part of memory_in_use, one per shell open in a record, by job.
host: Option<HostBudget>What the host’s memory leaves runners beside its other programs, from a recent reading of it; absent without one.
cpu: Option<CpuBudget>The CPU budget, under [host] cpu_overcommit. Absent without one.
slice_cpus: Option<u64>The CPUs the slice may use, in millicores: its AllowedCPUs or the host’s, less under a lower CPUQuota,
whether or not a CPU budget admits runners. The runners’ CPU limits are quotas that may add up past it.
Absent when it could not be read.
Implementations§
Source§impl Budget
impl Budget
Sourcepub fn memory_reading(&self) -> Reading
pub fn memory_reading(&self) -> Reading
What is reserved of what, as every client shows it: 8G of 24G reserved in runnerd.slice, or without
MemoryMax 8G reserved in runnerd.slice, which has no MemoryMax; while pooling takes something off, 36.8G
of 46G counted in ci.slice by predicted peaks: 42.8G reserved, 6G pooled; how runners are admitted
(Budget::admission_note) follows the slice.
Sourcepub fn counted(&self) -> u64
pub fn counted(&self) -> u64
What MemoryMax goes by, in bytes: memory_in_use, less what pooling takes off it (ADR 0099).
Sourcepub fn clauses(&self) -> Vec<String>
pub fn clauses(&self) -> Vec<String>
The budget’s clauses in the order clients show them: memory (Budget::memory_reading), then CPU
(CpuBudget::line) and the host (Budget::host_line) when the daemon reports them.
Sourcepub fn host_line(&self) -> Option<String>
pub fn host_line(&self) -> Option<String>
The host’s line as clients show it, such as host: 31G of 64G available, 1.5% stalled for memory; leaves the slice 40G; on a host with swap, host: 31G of 64G available, swap 12.1G of 15.5G used, … (ADR 0101); when that
is less room than MemoryMax leaves (Budget::host_withheld), …; leaves the slice 25G of its 46G, so 6.5G is free, or past MemoryMax (Budget::host_share) …; leaves the slice 47.5G for the 44.3G reserved there, so 3.2G is free, and without MemoryMax, where the host alone bounds it, …; leaves the slice 25G, so 6.5G is free; while it stalls, …; stalling, so no runner starts. While the slice is held
(Budget::held), nothing is free, so it says no figure of it. While the host’s limit takes a credit (ADR 0108),
what it counts follows: …; what runs counts 23G: it uses 14G and keeps 9G for growth
(HostBudget::growth_clause), unless the growth count counts, which Budget::memory_reading says. With programs
outside the slice large enough to
name, …; programs outside CI hold 30G, most java 9.3G (HostMemory::outside_line). None without a recent
reading of the host.
Sourcepub fn host_figures(&self) -> Vec<HostFigure>
pub fn host_figures(&self) -> Vec<HostFigure>
The host’s line (Budget::host_line) as figures, for a client that lays them out in a row rather than as a
sentence: what the host has available, the swap used, the share of time it stalled for memory, what it leaves the
slice, what the host’s limit counts of what runs while a credit stands (ADR 0108), and what programs outside CI
hold. What is free is the bar’s own part (BudgetParts::free), so it is not a figure here. Empty without a
recent reading of the host.
Sourcepub fn host_withheld(&self) -> Option<u64>
pub fn host_withheld(&self) -> Option<u64>
What the host’s memory holds back of the room MemoryMax leaves beside what runs, in bytes: that room less
what the host has to spare (HostBudget::spare), when the host leaves less. None while it leaves as much,
while it stalls (its line says no runner starts), without a recent reading of it, and without MemoryMax.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Budget
impl<'de> Deserialize<'de> for Budget
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 Budget
impl StructuralPartialEq for Budget
Auto Trait Implementations§
impl Forget for Budget
impl Freeze for Budget
impl Move for Budget
impl RefUnwindSafe for Budget
impl Send for Budget
impl Sync for Budget
impl Unpin for Budget
impl UnsafeUnpin for Budget
impl UnwindSafe for Budget
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.