mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
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
1 changed files with 8 additions and 0 deletions
|
@ -119,6 +119,14 @@ impl Diagnostic {
|
|||
pub fn get_max_history_length(&self) -> usize {
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue