diff options
Diffstat (limited to 'src/data_collection/memory.rs')
-rw-r--r-- | src/data_collection/memory.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/data_collection/memory.rs b/src/data_collection/memory.rs new file mode 100644 index 00000000..dee65d8d --- /dev/null +++ b/src/data_collection/memory.rs @@ -0,0 +1,26 @@ +//! Memory data collection. + +#[cfg(not(target_os = "windows"))] +pub(crate) use self::sysinfo::get_cache_usage; +pub(crate) use self::sysinfo::get_ram_usage; + +pub mod sysinfo; +cfg_if::cfg_if! { + if #[cfg(target_os = "windows")] { + pub mod windows; + pub(crate) use self::windows::get_swap_usage; + } else { + pub(crate) use self::sysinfo::get_swap_usage; + + } +} + +#[cfg(feature = "zfs")] +pub mod arc; + +#[derive(Debug, Clone, Default)] +pub struct MemHarvest { + pub used_bytes: u64, + pub total_bytes: u64, + pub use_percent: Option<f64>, // TODO: Might be find to just make this an f64, and any consumer checks NaN. +} |