From dbed44198b24d4397d007dd551e393b72300718a Mon Sep 17 00:00:00 2001 From: Twan Stok Date: Mon, 13 Mar 2023 03:28:32 +0100 Subject: [PATCH] First implementation of cache memory display, copied from RAM and swap implementations. placed cache as second in the list as it is more similar to the RAM than any other item in the list --- src/bin/main.rs | 5 ++++- src/canvas/canvas_styling.rs | 2 ++ src/canvas/widgets/mem_graph.rs | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/bin/main.rs b/src/bin/main.rs index 697fc27f..3fb84122 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -239,6 +239,8 @@ fn main() -> Result<()> { if app.used_widgets.use_mem { app.converted_data.mem_data = convert_mem_data_points(&app.data_collection); + app.converted_data.cache_data = + convert_cache_data_points(&app.data_collection); app.converted_data.swap_data = convert_swap_data_points(&app.data_collection); #[cfg(feature = "zfs")] @@ -251,10 +253,11 @@ fn main() -> Result<()> { app.converted_data.gpu_data = convert_gpu_data(&app.data_collection); } - let (memory_labels, swap_labels) = + let (memory_labels, cache_labels, swap_labels) = convert_mem_labels(&app.data_collection); app.converted_data.mem_labels = memory_labels; + app.converted_data.cache_labels = cache_labels; app.converted_data.swap_labels = swap_labels; #[cfg(feature = "zfs")] { diff --git a/src/canvas/canvas_styling.rs b/src/canvas/canvas_styling.rs index e0de7285..d63736df 100644 --- a/src/canvas/canvas_styling.rs +++ b/src/canvas/canvas_styling.rs @@ -18,6 +18,7 @@ pub struct CanvasColours { pub currently_selected_text_style: Style, pub table_header_style: Style, pub ram_style: Style, + pub cache_style: Style, pub swap_style: Style, pub arc_style: Style, pub gpu_colour_styles: Vec