pub enum TimeMetric {
Age,
Duty,
Rent,
Stale,
}Expand description
Time and staleness keys (SPEC §7 “Staleness”): comparisons age>1d, duty<1%, rent>10, stale>0.5
and the sort keys of the same names. Kept apart from Metric so that exhaustive matches on Metric
in frontends keep compiling.
Variants§
Age
Seconds since the group’s root (else oldest member) started.
Duty
CPU time ÷ age, percent of one core.
Rent
Idle rent, GiB-hours.
Stale
Staleness score, 0..1.
Implementations§
Source§impl TimeMetric
impl TimeMetric
pub const ALL: [TimeMetric; 4]
pub fn as_str(self) -> &'static str
Sourcepub fn parse(s: &str) -> Option<TimeMetric>
pub fn parse(s: &str) -> Option<TimeMetric>
Accepts the key and its aliases (uptime, duty_cycle, idle_rent, staleness).
Sourcepub fn descending(self) -> bool
pub fn descending(self) -> bool
Larger first when sorting (oldest, busiest, most rent, most stale)? duty sorts ascending: the
least-used first.
Trait Implementations§
Source§impl Clone for TimeMetric
impl Clone for TimeMetric
impl Copy for TimeMetric
Source§impl Debug for TimeMetric
impl Debug for TimeMetric
Source§impl<'de> Deserialize<'de> for TimeMetric
impl<'de> Deserialize<'de> for TimeMetric
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TimeMetric
Source§impl Hash for TimeMetric
impl Hash for TimeMetric
Source§impl PartialEq for TimeMetric
impl PartialEq for TimeMetric
Source§impl Serialize for TimeMetric
impl Serialize for TimeMetric
impl StructuralPartialEq for TimeMetric
Auto Trait Implementations§
impl Forget for TimeMetric
impl Freeze for TimeMetric
impl Move for TimeMetric
impl RefUnwindSafe for TimeMetric
impl Send for TimeMetric
impl Sync for TimeMetric
impl Unpin for TimeMetric
impl UnsafeUnpin for TimeMetric
impl UnwindSafe for TimeMetric
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
Mutably borrows from an owned value. Read more