summaryrefslogtreecommitdiffstats
path: root/src/app/data_harvester/processes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/data_harvester/processes.rs')
-rw-r--r--src/app/data_harvester/processes.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/app/data_harvester/processes.rs b/src/app/data_harvester/processes.rs
index 5d14930e..7d042635 100644
--- a/src/app/data_harvester/processes.rs
+++ b/src/app/data_harvester/processes.rs
@@ -83,6 +83,18 @@ pub struct ProcessHarvest {
/// This is the process' user.
pub user: Cow<'static, str>,
+
+ /// Gpu memory usage as bytes.
+ #[cfg(feature = "gpu")]
+ pub gpu_mem: u64,
+
+ /// Gpu memory usage as percentage.
+ #[cfg(feature = "gpu")]
+ pub gpu_mem_percent: f32,
+
+ /// Gpu utilization as a percentage.
+ #[cfg(feature = "gpu")]
+ pub gpu_util: u32,
// TODO: Additional fields
// pub rss_kb: u64,
// pub virt_kb: u64,
@@ -98,6 +110,12 @@ impl ProcessHarvest {
self.total_read_bytes += rhs.total_read_bytes;
self.total_write_bytes += rhs.total_write_bytes;
self.time += rhs.time;
+ #[cfg(feature = "gpu")]
+ {
+ self.gpu_mem += rhs.gpu_mem;
+ self.gpu_util += rhs.gpu_util;
+ self.gpu_mem_percent += rhs.gpu_mem_percent;
+ }
}
}