summaryrefslogtreecommitdiffstats
path: root/src/data_conversion.rs
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2020-04-11 21:02:27 -0400
committerGitHub <noreply@github.com>2020-04-11 21:02:27 -0400
commita351f05d4a111130a751dbad85eadb0d718d3f97 (patch)
tree7a23688fadc8c321614f218991caeb662c01a455 /src/data_conversion.rs
parentf210681ae7bd241053e7d373595854de3bc4b655 (diff)
feature: Show process state (#114)
This is not 100% finished and will be refined in the future, as I plan to do a bit of an overhaul on how the process widget is going to look and functionality. In particular, tabbed is currently kinda just slapped together (I just combine all the states together as one big string). However, it is enough to work and show state normally...
Diffstat (limited to 'src/data_conversion.rs')
-rw-r--r--src/data_conversion.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/data_conversion.rs b/src/data_conversion.rs
index 2991b92f..103a3917 100644
--- a/src/data_conversion.rs
+++ b/src/data_conversion.rs
@@ -35,6 +35,7 @@ pub struct ConvertedProcessData {
pub write_per_sec: String,
pub total_read: String,
pub total_write: String,
+ pub process_states: String,
}
#[derive(Clone, Default, Debug)]
@@ -47,6 +48,7 @@ pub struct SingleProcessData {
pub write_per_sec: u64,
pub total_read: u64,
pub total_write: u64,
+ pub process_state: String,
}
#[derive(Clone, Default, Debug)]
@@ -372,6 +374,7 @@ pub fn convert_process_data(
(*entry).write_per_sec += process.write_bytes_per_sec;
(*entry).total_read += process.total_read_bytes;
(*entry).total_write += process.total_write_bytes;
+ (*entry).process_state.push(process.process_state_char);
single_list.insert(process.pid, process.clone());
}
@@ -403,6 +406,7 @@ pub fn convert_process_data(
write_per_sec,
total_read,
total_write,
+ process_states: p.process_state,
}
})
.collect::<Vec<_>>();