pub struct MonitorData {
pub modules: Vec<ModuleData>,
pub last_updated: Instant,
}Expand description
Complete parsed monitor data ready for display.
Fields§
§modules: Vec<ModuleData>All modules sorted by health status (critical first).
last_updated: InstantWhen this snapshot was processed.
Implementations§
Source§impl MonitorData
impl MonitorData
Sourcepub fn load(path: &Path, thresholds: &Thresholds) -> Result<Self>
pub fn load(path: &Path, thresholds: &Thresholds) -> Result<Self>
Load and parse monitor data from a JSON file.
This is the traditional file-based loading method.
Sourcepub fn parse(content: &str, thresholds: &Thresholds) -> Result<Self>
pub fn parse(content: &str, thresholds: &Thresholds) -> Result<Self>
Parse monitor data from a JSON string.
Sourcepub fn from_snapshot(snapshot: Snapshot, thresholds: &Thresholds) -> Self
pub fn from_snapshot(snapshot: Snapshot, thresholds: &Thresholds) -> Self
Convert a Snapshot into processed MonitorData.
This is the primary conversion method used by all data sources.
Sourcepub fn unhealthy_topics(&self) -> Vec<(&ModuleData, UnhealthyTopic)>
pub fn unhealthy_topics(&self) -> Vec<(&ModuleData, UnhealthyTopic)>
Get all unhealthy topics across all modules.
Trait Implementations§
Source§impl Clone for MonitorData
impl Clone for MonitorData
Source§fn clone(&self) -> MonitorData
fn clone(&self) -> MonitorData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MonitorData
impl RefUnwindSafe for MonitorData
impl Send for MonitorData
impl Sync for MonitorData
impl Unpin for MonitorData
impl UnwindSafe for MonitorData
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more