Skip to content

Commit

Permalink
fixed bug where updated disks stats overrided disk io data
Browse files Browse the repository at this point in the history
  • Loading branch information
crestfallnbutnew authored and aristocratos committed Sep 29, 2023
1 parent 9b4e85f commit cdcf8bc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/btop_shared.hpp
Expand Up @@ -147,7 +147,6 @@ namespace Mem {
int64_t free{}; // defaults to 0
int used_percent{}; // defaults to 0
int free_percent{}; // defaults to 0
bool is_ready = false;

array<int64_t, 3> old_io = {0, 0, 0};
deque<long long> io_read = {};
Expand Down
2 changes: 0 additions & 2 deletions src/linux/btop_collect.cpp
Expand Up @@ -1111,7 +1111,6 @@ namespace Mem {
disk.used = updated_stats.used;
disk.used_percent = updated_stats.used_percent;
disk.free_percent = updated_stats.free_percent;
disk.is_ready = true;
}
disks_stats_promises[mountpoint] = async(std::launch::async, [mountpoint, &free_priv]() -> pair<disk_info, int> {
struct statvfs vfs;
Expand Down Expand Up @@ -1156,7 +1155,6 @@ namespace Mem {
int64_t sectors_read, sectors_write, io_ticks, io_ticks_temp;
disk_ios = 0;
for (auto& [ignored, disk] : disks) {
if(!disk.is_ready) continue;
if (disk.stat.empty() or access(disk.stat.c_str(), R_OK) != 0) continue;
if (disk.fstype == "zfs" && zfs_hide_datasets && zfs_collect_pool_total_stats(disk)) {
disk_ios++;
Expand Down

0 comments on commit cdcf8bc

Please sign in to comment.