mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-27 07:34:27 +02:00
refactor: Remove some dead code
This commit is contained in:
parent
cc66f1fcae
commit
16babea202
@ -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>,
|
||||
|
@ -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,
|
||||
|
||||
|
@ -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());
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user