fold hive-c0re module tree into the daemon binary + drop dead pub items surfaced by bin-only (#2513)
This commit is contained in:
parent
d04c86e9ac
commit
673aea4e50
15 changed files with 95 additions and 250 deletions
|
|
@ -93,12 +93,6 @@ impl SweepHealth {
|
|||
None => self.guard = Some(set_warning(self.kind, self.level, msg)),
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether the banner warning is currently raised for this sweep.
|
||||
#[must_use]
|
||||
pub fn is_warning(&self) -> bool {
|
||||
self.guard.is_some()
|
||||
}
|
||||
}
|
||||
|
||||
/// Compact human-readable age (e.g. `"45s"`, `"12m"`, `"3h"`, `"2d"`) for a
|
||||
|
|
@ -135,7 +129,7 @@ mod tests {
|
|||
let mut h = SweepHealth::new("sh_below", "warn", 3);
|
||||
h.record_err(|_| "boom".to_owned());
|
||||
h.record_err(|_| "boom".to_owned());
|
||||
assert!(!h.is_warning());
|
||||
assert!(h.guard.is_none());
|
||||
assert!(banner("sh_below").is_none());
|
||||
}
|
||||
|
||||
|
|
@ -146,9 +140,9 @@ mod tests {
|
|||
assert!(banner("sh_raise").is_none(), "one miss < threshold");
|
||||
h.record_err(|c| format!("fail #{}", c.consecutive));
|
||||
assert_eq!(banner("sh_raise").as_deref(), Some("fail #2"));
|
||||
assert!(h.is_warning());
|
||||
assert!(h.guard.is_some());
|
||||
h.record_ok();
|
||||
assert!(!h.is_warning());
|
||||
assert!(h.guard.is_none());
|
||||
assert!(banner("sh_raise").is_none(), "success clears the banner");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue