summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClementTsang <cjhtsang@uwaterloo.ca>2021-11-20 22:47:44 -0500
committerClementTsang <cjhtsang@uwaterloo.ca>2021-11-20 23:28:40 -0500
commit16babea2021686b0189ff104d73e71127129ca3c (patch)
tree61238f4ce646e0286b7055ce36c305a909a0fb40
parentcc66f1fcaea6d31581efea7dfc1b0029e4754f49 (diff)
refactor: Remove some dead code
-rw-r--r--src/app/data_harvester/network/heim.rs2
-rw-r--r--src/app/data_harvester/processes.rs20
-rw-r--r--src/app/widgets/base/scrollable.rs2
-rw-r--r--src/data_conversion.rs38
4 files changed, 5 insertions, 57 deletions
diff --git a/src/app/data_harvester/network/heim.rs b/src/app/data_harvester/network/heim.rs
index 6d05cc60..62a3d0ca 100644
--- a/src/app/data_harvester/network/heim.rs
+++ b/src/app/data_harvester/network/heim.rs
@@ -3,7 +3,7 @@
use super::NetworkHarvest;
use std::time::Instant;
-// FIXME: Eventually make it so that this thing also takes individual usage into account, so we can allow for showing per-interface!
+// TODO: [Feature] Eventually make it so that this thing also takes individual usage into account, so we can allow for showing per-interface!
pub async fn get_network_data(
prev_net_access_time: Instant, prev_net_rx: &mut u64, prev_net_tx: &mut u64,
curr_time: Instant, actually_get: bool, filter: &Option<crate::app::Filter>,
diff --git a/src/app/data_harvester/processes.rs b/src/app/data_harvester/processes.rs
index bcbc97e0..c1da47b1 100644
--- a/src/app/data_harvester/processes.rs
+++ b/src/app/data_harvester/processes.rs
@@ -27,24 +27,6 @@ use std::borrow::Cow;
use crate::Pid;
-// FIXME: [URGENT] Delete this.
-#[derive(Clone, PartialEq, Eq, Hash, Debug)]
-pub enum ProcessSorting {
- CpuPercent,
- Mem,
- MemPercent,
- Pid,
- ProcessName,
- Command,
- ReadPerSecond,
- WritePerSecond,
- TotalRead,
- TotalWrite,
- State,
- User,
- Count,
-}
-
#[derive(Debug, Clone, Default)]
pub struct ProcessHarvest {
pub pid: Pid,
@@ -63,7 +45,7 @@ pub struct ProcessHarvest {
pub process_state: String,
pub process_state_char: char,
- /// This is the *effective* user ID. This is only used on Unix platforms.
+ /// This is the effective user ID. This is only used on Unix platforms.
#[cfg(target_family = "unix")]
pub uid: libc::uid_t,
diff --git a/src/app/widgets/base/scrollable.rs b/src/app/widgets/base/scrollable.rs
index 5d5620ae..9f07a794 100644
--- a/src/app/widgets/base/scrollable.rs
+++ b/src/app/widgets/base/scrollable.rs
@@ -238,7 +238,7 @@ impl Component for Scrollable {
// we are using a *visual* index here - not what is the actual index! Luckily, we keep track of that
// inside our linked copy of TableState!
- // Note that y is assumed to be *relative*;
+ // Note that y is assumed to be relative;
// we assume that y starts at where the list starts (and there are no gaps or whatever).
let y = usize::from(event.row - self.bounds.top());
diff --git a/src/data_conversion.rs b/src/data_conversion.rs
index 5731693e..40704517 100644
--- a/src/data_conversion.rs
+++ b/src/data_conversion.rs
@@ -1,10 +1,9 @@
-//! This mainly concerns converting collected data into things that the canvas
-//! can actually handle.
+//! This mainly concerns converting collected data into things that the canvas can actually handle.
use crate::app::data_harvester::temperature::TemperatureType;
use crate::app::text_table::TextTableData;
use crate::app::DataCollection;
use crate::{app::data_harvester, utils::gen_util::*};
-use crate::{app::AxisScaling, units::data_units::DataUnit, Pid};
+use crate::{app::AxisScaling, units::data_units::DataUnit};
use std::borrow::Cow;
@@ -50,39 +49,6 @@ pub struct ConvertedNetworkData {
// mean_tx: f64,
}
-// TODO: [Refactor] Process data might need some refactoring lol
-#[derive(Clone, Default, Debug)]
-pub struct ConvertedProcessData {
- pub pid: Pid,
- pub ppid: Option<Pid>,
- pub name: String,
- pub command: String,
- pub is_thread: Option<bool>,
- pub cpu_percent_usage: f64,
- pub mem_percent_usage: f64,
- pub mem_usage_bytes: u64,
- pub mem_usage_str: (f64, String),
- pub group_pids: Vec<Pid>,
- pub read_per_sec: String,
- pub write_per_sec: String,
- pub total_read: String,
- pub total_write: String,
- pub rps_f64: f64,
- pub wps_f64: f64,
- pub tr_f64: f64,
- pub tw_f64: f64,
- pub process_state: String,
- pub process_char: char,
- pub user: Option<String>,
-
- /// Prefix printed before the process when displayed.
- pub process_description_prefix: Option<String>,
- /// Whether to mark this process entry as disabled (mostly for tree mode).
- pub is_disabled_entry: bool,
- /// Whether this entry is collapsed, hiding all its children (for tree mode).
- pub is_collapsed_entry: bool,
-}
-
#[derive(Clone, Default, Debug)]
pub struct ConvertedCpuData {
pub cpu_name: String,