mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-23 21:55:11 +02:00
feature: add back states to unmerged processes
This commit is contained in:
parent
e2e1ac3006
commit
cf1d41c83a
@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
- TODO: ~~[#114](https://github.com/ClementTsang/bottom/pull/114): Process state per process (originally in 0.4.0, moved to later).~~
|
- [#114](https://github.com/ClementTsang/bottom/pull/114): Show process state per process (originally in 0.4.0, moved to later). This only
|
||||||
|
shows if the processes are not merged together; I couldn't think of a nice way to show it when grouped together, unfortunately.
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ As yet _another_ process/system visualization and management application, bottom
|
|||||||
|
|
||||||
- Display temperatures from sensors
|
- Display temperatures from sensors
|
||||||
|
|
||||||
- Display information regarding processes, like CPU, memory, and I/O usage
|
- Display information regarding processes, like CPU, memory, I/O usage, and process state
|
||||||
|
|
||||||
- Process management (process killing _is_ all you need, right?)
|
- Process management (process killing _is_ all you need, right?)
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ impl ProcessTableWidget for Painter {
|
|||||||
let wps = "W/s".to_string();
|
let wps = "W/s".to_string();
|
||||||
let total_read = "Read".to_string();
|
let total_read = "Read".to_string();
|
||||||
let total_write = "Write".to_string();
|
let total_write = "Write".to_string();
|
||||||
// let process_state = "State".to_string();
|
let process_state = "State".to_string();
|
||||||
|
|
||||||
let direction_val = if proc_widget_state.process_sorting_reverse {
|
let direction_val = if proc_widget_state.process_sorting_reverse {
|
||||||
"▼".to_string()
|
"▼".to_string()
|
||||||
@ -161,17 +161,30 @@ impl ProcessTableWidget for Painter {
|
|||||||
ProcessSorting::NAME => name += &direction_val,
|
ProcessSorting::NAME => name += &direction_val,
|
||||||
};
|
};
|
||||||
|
|
||||||
let process_headers = [
|
let process_headers = if proc_widget_state.is_grouped {
|
||||||
pid_or_name,
|
vec![
|
||||||
name,
|
pid_or_name,
|
||||||
cpu,
|
name,
|
||||||
mem,
|
cpu,
|
||||||
rps,
|
mem,
|
||||||
wps,
|
rps,
|
||||||
total_read,
|
wps,
|
||||||
total_write,
|
total_read,
|
||||||
// process_state,
|
total_write,
|
||||||
];
|
]
|
||||||
|
} else {
|
||||||
|
vec![
|
||||||
|
pid_or_name,
|
||||||
|
name,
|
||||||
|
cpu,
|
||||||
|
mem,
|
||||||
|
rps,
|
||||||
|
wps,
|
||||||
|
total_read,
|
||||||
|
total_write,
|
||||||
|
process_state,
|
||||||
|
]
|
||||||
|
};
|
||||||
let process_headers_lens: Vec<usize> = process_headers
|
let process_headers_lens: Vec<usize> = process_headers
|
||||||
.iter()
|
.iter()
|
||||||
.map(|entry| entry.len())
|
.map(|entry| entry.len())
|
||||||
@ -179,7 +192,11 @@ impl ProcessTableWidget for Painter {
|
|||||||
|
|
||||||
// Calculate widths
|
// Calculate widths
|
||||||
let width = f64::from(draw_loc.width);
|
let width = f64::from(draw_loc.width);
|
||||||
let width_ratios = [0.1, 0.2, 0.1, 0.1, 0.1, 0.1, 0.15, 0.15];
|
let width_ratios = if proc_widget_state.is_grouped {
|
||||||
|
vec![0.1, 0.2, 0.1, 0.1, 0.1, 0.1, 0.15, 0.15]
|
||||||
|
} else {
|
||||||
|
vec![0.1, 0.2, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
|
||||||
|
};
|
||||||
let variable_intrinsic_results = get_variable_intrinsic_widths(
|
let variable_intrinsic_results = get_variable_intrinsic_widths(
|
||||||
width as u16,
|
width as u16,
|
||||||
&width_ratios,
|
&width_ratios,
|
||||||
|
@ -383,7 +383,6 @@ pub fn convert_process_data(
|
|||||||
(*entry).write_per_sec += process.write_bytes_per_sec;
|
(*entry).write_per_sec += process.write_bytes_per_sec;
|
||||||
(*entry).total_read += process.total_read_bytes;
|
(*entry).total_read += process.total_read_bytes;
|
||||||
(*entry).total_write += process.total_write_bytes;
|
(*entry).total_write += process.total_write_bytes;
|
||||||
(*entry).process_state.push(process.process_state_char);
|
|
||||||
|
|
||||||
let converted_rps = get_exact_byte_values(process.read_bytes_per_sec, false);
|
let converted_rps = get_exact_byte_values(process.read_bytes_per_sec, false);
|
||||||
let converted_wps = get_exact_byte_values(process.write_bytes_per_sec, false);
|
let converted_wps = get_exact_byte_values(process.write_bytes_per_sec, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user