mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-09-23 17:58:06 +02:00
bug: change heim io fn to not bail on any error
This commit is contained in:
parent
105e9d27bb
commit
3843d63dbb
@ -72,28 +72,30 @@ pub async fn get_heim_io_usage_list(
|
|||||||
if get_physical {
|
if get_physical {
|
||||||
let mut physical_counter_stream = heim::disk::io_counters_physical();
|
let mut physical_counter_stream = heim::disk::io_counters_physical();
|
||||||
while let Some(io) = physical_counter_stream.next().await {
|
while let Some(io) = physical_counter_stream.next().await {
|
||||||
let io = io?;
|
if let Ok(io) = io {
|
||||||
let mount_point = io.device_name().to_str().unwrap_or("Name Unavailable");
|
let mount_point = io.device_name().to_str().unwrap_or("Name Unavailable");
|
||||||
io_hash.insert(
|
io_hash.insert(
|
||||||
mount_point.to_string(),
|
mount_point.to_string(),
|
||||||
Some(IOData {
|
Some(IOData {
|
||||||
read_bytes: io.read_bytes().get::<heim::units::information::megabyte>(),
|
read_bytes: io.read_bytes().get::<heim::units::information::megabyte>(),
|
||||||
write_bytes: io.write_bytes().get::<heim::units::information::megabyte>(),
|
write_bytes: io.write_bytes().get::<heim::units::information::megabyte>(),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let mut counter_stream = heim::disk::io_counters();
|
let mut counter_stream = heim::disk::io_counters();
|
||||||
while let Some(io) = counter_stream.next().await {
|
while let Some(io) = counter_stream.next().await {
|
||||||
let io = io?;
|
if let Ok(io) = io {
|
||||||
let mount_point = io.device_name().to_str().unwrap_or("Name Unavailable");
|
let mount_point = io.device_name().to_str().unwrap_or("Name Unavailable");
|
||||||
io_hash.insert(
|
io_hash.insert(
|
||||||
mount_point.to_string(),
|
mount_point.to_string(),
|
||||||
Some(IOData {
|
Some(IOData {
|
||||||
read_bytes: io.read_bytes().get::<heim::units::information::byte>(),
|
read_bytes: io.read_bytes().get::<heim::units::information::byte>(),
|
||||||
write_bytes: io.write_bytes().get::<heim::units::information::byte>(),
|
write_bytes: io.write_bytes().get::<heim::units::information::byte>(),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user