Send the requests to the loader and render them

This commit is contained in:
Olivier 'reivilibre' 2022-01-08 16:41:15 +00:00
parent 9b24993736
commit 9cc141e227
2 changed files with 15 additions and 2 deletions

View File

@ -190,6 +190,7 @@ pub enum MetricsLogReaderMessage {
LoadNewWindow { LoadNewWindow {
new_time_range: RangeInclusive<f64>, new_time_range: RangeInclusive<f64>,
new_wanted_time_points: u32, new_wanted_time_points: u32,
requests: Vec<GraphRequest>,
}, },
} }
@ -527,6 +528,7 @@ impl<R: Read + Seek> MetricsLogReaderManager<R> {
new_window.points.push((next_val.0, rate)); new_window.points.push((next_val.0, rate));
last_val = *next_val; last_val = *next_val;
} }
new_window.summarise_in_place();
metrics_window.scalars.insert(request, new_window); metrics_window.scalars.insert(request, new_window);
} }
} }
@ -703,6 +705,7 @@ impl<R: Read + Seek> MetricsLogReaderManager<R> {
MetricsLogReaderMessage::LoadNewWindow { MetricsLogReaderMessage::LoadNewWindow {
new_time_range, new_time_range,
new_wanted_time_points, new_wanted_time_points,
requests,
} => { } => {
debug!( debug!(
"Requested new window; time range {:?}, № points {}", "Requested new window; time range {:?}, № points {}",
@ -755,7 +758,7 @@ impl<R: Read + Seek> MetricsLogReaderManager<R> {
UnixTimestampMilliseconds(start), UnixTimestampMilliseconds(start),
UnixTimestampMilliseconds(end), UnixTimestampMilliseconds(end),
new_wanted_time_points, new_wanted_time_points,
Default::default(), // TODO requests,
)?; )?;
debug!("METRIC WINDOW {:#?}", metric_window); debug!("METRIC WINDOW {:#?}", metric_window);

View File

@ -10,7 +10,7 @@ use eframe::epi::{App, Frame, Storage};
use eframe::NativeOptions; use eframe::NativeOptions;
use env_logger::Env; use env_logger::Env;
use log::{debug, info, warn}; use log::{debug, info, warn};
use std::collections::{BTreeMap}; use std::collections::BTreeMap;
use std::fs::File; use std::fs::File;
use std::path::PathBuf; use std::path::PathBuf;
use std::str::FromStr; use std::str::FromStr;
@ -71,6 +71,7 @@ impl App for MetricsGui {
.send(MetricsLogReaderMessage::LoadNewWindow { .send(MetricsLogReaderMessage::LoadNewWindow {
new_time_range: f64::NEG_INFINITY..=f64::INFINITY, new_time_range: f64::NEG_INFINITY..=f64::INFINITY,
new_wanted_time_points: 512, new_wanted_time_points: 512,
requests: Vec::with_capacity(0),
}) })
.unwrap(); .unwrap();
} }
@ -113,6 +114,15 @@ impl MetricsGui {
} else { } else {
// TODO Build some stuff automatically based on alphabetical ordering // TODO Build some stuff automatically based on alphabetical ordering
} }
self.requester
.tx
.send(MetricsLogReaderMessage::LoadNewWindow {
new_time_range: f64::NEG_INFINITY..=f64::INFINITY,
new_wanted_time_points: 512,
requests: self.graph_requests.clone(),
})
.unwrap();
} }
} }