summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/canvas.rs4
-rw-r--r--src/data_conversion.rs6
-rw-r--r--src/main.rs2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/canvas.rs b/src/canvas.rs
index c863cca4..00e70d41 100644
--- a/src/canvas.rs
+++ b/src/canvas.rs
@@ -346,8 +346,8 @@ pub fn draw_data<B: backend::Backend>(terminal: &mut Terminal<B>, app_state: &mu
let x_axis: Axis<String> = Axis::default().style(Style::default().fg(GRAPH_COLOUR)).bounds([0.0, 600_000.0]);
let y_axis = Axis::default()
.style(Style::default().fg(GRAPH_COLOUR))
- .bounds([-0.5, 1_000_000.5])
- .labels(&["0GB", "1GB"]);
+ .bounds([-0.5, 30_f64])
+ .labels(&["0B", "1KiB", "1MiB", "1GiB"]);
Chart::default()
.block(
Block::default()
diff --git a/src/data_conversion.rs b/src/data_conversion.rs
index 2fdf91e4..82aa5601 100644
--- a/src/data_conversion.rs
+++ b/src/data_conversion.rs
@@ -251,13 +251,15 @@ pub fn convert_network_data_points(network_data: &[data_collection::network::Net
let current_time = std::time::Instant::now();
let rx_data = (
((TIME_STARTS_FROM as f64 - current_time.duration_since(data.instant).as_millis() as f64) * 10_f64).floor(),
- data.rx as f64 / 1024.0,
+ if data.rx > 0 { (data.rx as f64).log(2.0) } else { 0.0 },
);
let tx_data = (
((TIME_STARTS_FROM as f64 - current_time.duration_since(data.instant).as_millis() as f64) * 10_f64).floor(),
- data.tx as f64 / 1024.0,
+ if data.tx > 0 { (data.tx as f64).log(2.0) } else { 0.0 },
);
+ //debug!("Plotting: {:?} bytes rx, {:?} bytes tx", rx_data, tx_data);
+
// Now, inject our joining points...
if !rx.is_empty() {
let previous_element_data = *(rx.last().unwrap());
diff --git a/src/main.rs b/src/main.rs
index 65990299..8a6ff033 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -50,7 +50,6 @@ fn main() -> error::Result<()> {
(version: crate_version!())
(author: crate_authors!())
(about: crate_description!())
- //(@arg THEME: -t --theme +takes_value "Sets a colour theme.")
(@arg AVG_CPU: -a --avgcpu "Enables showing the average CPU usage.")
(@arg DOT_MARKER: -m --dot_marker "Use a dot marker instead of the default braille marker. May be needed in things like Powershell.")
(@arg DEBUG: -d --debug "Enables debug mode.")
@@ -61,7 +60,6 @@ fn main() -> error::Result<()> {
)
(@arg RATE_MILLIS: -r --rate +takes_value "Sets a refresh rate in milliseconds; the minimum is 250ms, defaults to 1000ms. Smaller values may take more resources.")
)
- //.after_help("Themes:") // TODO: This and others disabled for now
.get_matches();
let update_rate_in_milliseconds: u128 = if matches.is_present("RATE_MILLIS") {