summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TODO.md64
-rw-r--r--src/canvas.rs2
-rw-r--r--src/convert_data.rs12
3 files changed, 40 insertions, 38 deletions
diff --git a/TODO.md b/TODO.md
index 8fd9783f..a38ea68c 100644
--- a/TODO.md
+++ b/TODO.md
@@ -4,66 +4,68 @@ Note this will probably migrate to GitHub's native Issues; this was mostly for p
## Pre-release (bare minimum)
-* ~~Get each function working as a POC~~
+- ~~Get each function working as a POC~~
-* ~~Separate each component for readability, finalize project structure~~
+- ~~Separate each component for readability, finalize project structure~~
-* ~~Refreshing - how are we doing that? Are we allowing individual refresh periods per component?~~
+- ~~Refreshing - how are we doing that? Are we allowing individual refresh periods per component?~~
-* ~~Write tui display, charting~~
+- ~~Write tui display, charting~~
-* ~~FIX PROCESSES AHHHHHH~~
+- ~~FIX PROCESSES AHHHHHH~~
-* ~~Scrolling in at least processes~~
+- ~~Scrolling in at least processes~~
-* Keybindings - I want to do at least arrow keys and dd.
+- Keybindings - I want to do at least arrow keys and dd.
-* ~~Legend gets in the way at too small of a height... maybe modify tui a bit more to fix this.~~
+- ~~Legend gets in the way at too small of a height... maybe modify tui a bit more to fix this.~~
## After making public
-* Arrow keys for lists. This is a priority!
+- Consider bumping up the refresh rate to 3000?
-* Travis
+- Arrow keys for lists. This is a priority!
-* Refactoring! Please.
+- Travis
-* Scaling in and out (zoom), may need to show zoom levels
+- Refactoring! Please.
-* More keybinds
+- Scaling in and out (zoom), may need to show zoom levels
-* Tests
+- More keybinds
-* Mouse + key events conflict? Make it so that some events don't clog up the loop if they are not valid keys!
+- Tests
-* Header should be clear on current sorting direction!
+- Mouse + key events conflict? Make it so that some events don't clog up the loop if they are not valid keys!
-* It would be maybe a good idea to see if we can run the process calculation across ALL cpus...? Might be more accurate.
+- Header should be clear on current sorting direction!
-* ~~Add custom error because it's really messy~~ Done, but need to implement across rest of app!
+- It would be maybe a good idea to see if we can run the process calculation across ALL cpus...? Might be more accurate.
-* Remove any ``unwrap()``, ensure no crashing! Might have to use this: <https://doc.rust-lang.org/std/panic/fn.catch_unwind.html>
+- ~~Add custom error because it's really messy~~ Done, but need to implement across rest of app!
-* Scrolling event in lists
+- Remove any `unwrap()`, ensure no crashing! Might have to use this: <https://doc.rust-lang.org/std/panic/fn.catch_unwind.html>
-* Switching between panels
+- Scrolling event in lists
-* Truncate columns if needed for tables
+- Switching between panels
-* Test for Windows support, mac support, other. May be doable, depends on sysinfo and how much I know about other OSes probably.
+- Truncate columns if needed for tables
-* Seems like the braille symbols are borked on windows.
+- Test for Windows support, mac support, other. May be doable, depends on sysinfo and how much I know about other OSes probably.
-* Issue with typing after windows version runs!
+- Seems like the braille symbols are borked on windows.
-* Efficiency!!!
+- Issue with typing after windows version runs!
-* Filtering in processes (that is, allow searching)
+- Efficiency!!!
-* Help screen
+- Filtering in processes (that is, allow searching)
-* Modularity
+- Help screen
-* ~~Potentially process managing? Depends on the libraries...~~ Done on Linux!
+- Modularity
-* Probably good to add a "are you sure" to dd-ing...
+- ~~Potentially process managing? Depends on the libraries...~~ Done on Linux!
+
+- Probably good to add a "are you sure" to dd-ing...
diff --git a/src/canvas.rs b/src/canvas.rs
index c096b554..7e13dd8f 100644
--- a/src/canvas.rs
+++ b/src/canvas.rs
@@ -132,7 +132,7 @@ pub fn draw_data<B : backend::Backend>(terminal : &mut Terminal<B>, app_state :
.style(Style::default().fg(Color::LightBlue))
.data(&canvas_data.mem_data)];
- if !(&canvas_data.swap_data).is_empty() {
+ if !(&canvas_data.swap_data).is_empty() && (&canvas_data.swap_data).last().unwrap().1 >= 0.0 {
mem_canvas_vec.push(
Dataset::default()
.name(&swap_name)
diff --git a/src/convert_data.rs b/src/convert_data.rs
index e4f9ae84..d3bb3147 100644
--- a/src/convert_data.rs
+++ b/src/convert_data.rs
@@ -188,15 +188,15 @@ pub fn convert_mem_data(mem_data : &[data_collection::mem::MemData]) -> Vec<(f64
let mut result : Vec<(f64, f64)> = Vec::new();
for data in mem_data {
- if data.mem_total_in_mb == 0 {
- // Assume none (usually in the case of swap)! Also catches div by zero.
- return result;
- }
-
let current_time = std::time::Instant::now();
let new_entry = (
((STALE_MAX_MILLISECONDS as f64 - current_time.duration_since(data.instant).as_millis() as f64) * 10_f64).floor(),
- data.mem_used_in_mb as f64 / data.mem_total_in_mb as f64 * 100_f64,
+ if data.mem_total_in_mb == 0 {
+ -1000.0
+ }
+ else {
+ data.mem_used_in_mb as f64 / data.mem_total_in_mb as f64 * 100_f64
+ },
);
// Now, inject our joining points...