mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-24 22:24:53 +02:00
rustfmt
This commit is contained in:
parent
1c3bfdb0f9
commit
4afd71926f
@ -212,7 +212,11 @@ impl DataCollection {
|
||||
}
|
||||
|
||||
// Memory and Swap
|
||||
if let (Some(memory), Some(cache), Some(swap)) = (harvested_data.memory, harvested_data.cache, harvested_data.swap) {
|
||||
if let (Some(memory), Some(cache), Some(swap)) = (
|
||||
harvested_data.memory,
|
||||
harvested_data.cache,
|
||||
harvested_data.swap,
|
||||
) {
|
||||
self.eat_memory_and_swap(memory, cache, swap, &mut new_entry);
|
||||
}
|
||||
|
||||
@ -267,7 +271,8 @@ impl DataCollection {
|
||||
}
|
||||
|
||||
fn eat_memory_and_swap(
|
||||
&mut self, memory: memory::MemHarvest, cache: memory::MemHarvest, swap: memory::MemHarvest, new_entry: &mut TimedData,
|
||||
&mut self, memory: memory::MemHarvest, cache: memory::MemHarvest, swap: memory::MemHarvest,
|
||||
new_entry: &mut TimedData,
|
||||
) {
|
||||
// Memory
|
||||
new_entry.mem_data = memory.use_percent;
|
||||
|
@ -1,8 +1,8 @@
|
||||
//! Memory data collection.
|
||||
|
||||
pub mod sysinfo;
|
||||
pub(crate) use self::sysinfo::get_ram_usage;
|
||||
pub(crate) use self::sysinfo::get_cache_usage;
|
||||
pub(crate) use self::sysinfo::get_ram_usage;
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(target_os = "windows")] {
|
||||
|
@ -258,7 +258,11 @@ pub fn convert_swap_data_points(current_data: &DataCollection) -> Vec<Point> {
|
||||
|
||||
pub fn convert_mem_labels(
|
||||
current_data: &DataCollection,
|
||||
) -> (Option<(String, String)>, Option<(String, String)>, Option<(String, String)>) {
|
||||
) -> (
|
||||
Option<(String, String)>,
|
||||
Option<(String, String)>,
|
||||
Option<(String, String)>,
|
||||
) {
|
||||
/// Returns the unit type and denominator for given total amount of memory in kibibytes.
|
||||
fn return_unit_and_denominator_for_mem_kib(mem_total_kib: u64) -> (&'static str, f64) {
|
||||
if mem_total_kib < 1024 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user