pub struct MachineFacts {
pub cpus: Result<usize, String>,
pub memory: Result<(u64, u64), String>,
pub cgroup_memory_max: Option<u64>,
pub load1: Result<f64, String>,
pub disk: Option<Outcome>,
}Expand description
What the box has: cores, RAM, and how busy it is. Product-scope facts,
each either measured or carrying the reason it was not; machine_fields
turns them into the wire’s optional fields and the machine_reason.
Fields§
§cpus: Result<usize, String>CPUs this process may run on: the affinity mask, further limited by
a cgroup v2 cpu.max quota when one is set
(std::thread::available_parallelism, the spelling
crate::budget::Machine sizes the pools from). Err is the OS’s
reason the kernel would not say.
memory: Result<(u64, u64), String>(MemTotal, MemAvailable) in bytes as /proc/meminfo reports them,
then clamped by cgroup_memory_max when a limit is set. Err names why
/proc/meminfo could not be read or parsed.
cgroup_memory_max: Option<u64>The cgroup v2 memory.max that clamped memory, when one did and was
smaller than the box — reported so the reason line can say the quoted
RAM is the container’s, not the host’s.
load1: Result<f64, String>The 1-minute load average, or why /proc/loadavg could not be read.
disk: Option<Outcome>What the data root’s disk did at start-up: the last outcome of
crate::disktest, or None when the test has not finished one (the
gate was closed, or the thread is still running). A LOOKUP — reading
this never starts a disk test, because the answer wanted is what the
disk did at start-up on an idle box, not what it does under whatever
load is on it now.
Implementations§
Source§impl MachineFacts
impl MachineFacts
Sourcepub fn measure() -> MachineFacts
pub fn measure() -> MachineFacts
Read them off the running machine. Every reader is one the server already has (one implementation); this only keeps their failures instead of flattening them to a dash or a zero.
Trait Implementations§
Source§impl Clone for MachineFacts
impl Clone for MachineFacts
Source§impl Debug for MachineFacts
impl Debug for MachineFacts
Source§impl PartialEq for MachineFacts
impl PartialEq for MachineFacts
impl StructuralPartialEq for MachineFacts
Auto Trait Implementations§
impl Freeze for MachineFacts
impl RefUnwindSafe for MachineFacts
impl Send for MachineFacts
impl Sync for MachineFacts
impl Unpin for MachineFacts
impl UnsafeUnpin for MachineFacts
impl UnwindSafe for MachineFacts
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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