add get_history function to Diagnostic (#2772)
# Objective - Allow access to diagnostic history value. - Fixes #2771. ## Solution - Add Diagnostic::get_history function.
This commit is contained in:
parent
edd822a2bb
commit
18c08dd860
@ -119,6 +119,14 @@ impl Diagnostic {
|
|||||||
pub fn get_max_history_length(&self) -> usize {
|
pub fn get_max_history_length(&self) -> usize {
|
||||||
self.max_history_length
|
self.max_history_length
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn values(&self) -> impl Iterator<Item = &f64> {
|
||||||
|
self.history.iter().map(|x| &x.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn measurements(&self) -> impl Iterator<Item = &DiagnosticMeasurement> {
|
||||||
|
self.history.iter()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A collection of [Diagnostic]s
|
/// A collection of [Diagnostic]s
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user