Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple SWAP's breaks output #60

Closed
Mai-Lapyst opened this issue Nov 11, 2023 · 6 comments
Closed

Multiple SWAP's breaks output #60

Mai-Lapyst opened this issue Nov 11, 2023 · 6 comments

Comments

@Mai-Lapyst
Copy link
Contributor

SUMMARY

When a system has multiple swap's setup (cat /proc/swaps returns multiple lines), the output breaks in certain scenarious; both in CLI-mode and when generating a CSV; all values after the swap columns have an offset to the right.

ISSUE TYPE
  • Bug Report
DOOL VERSION

Dool 1.3.0
(installed via arch AUR: 1.3.0.r1.g332b828-1)

OS / ENVIRONMENT

Linux / Arch

STEPS TO REPRODUCE
  • Setup a system with two swap partitions
  • Run dool: dool --epoch --full --swap --aio
EXPECTED RESULTS

That output dosn't breaks if running with --full and --swap flags.

ACTUAL RESULTS
Plugins: ['epoch', 'swap', 'aio']
Module dool_epoch
Module dool_swap requires ['/proc/swaps']
Module dool_aio requires ['/proc/sys/fs/aio-nr']
┄┄┄┄epoch┄┄┄┄┬┄┄┄┄swap┄┄┄┬async
    epoch    │ used  free│ #aio
1699674984.79│   0    10G┊   0    10G│ 576B  0.18ms
1699674985.79│   0    10G┊   0    10G│ 576B  0.18ms
1699674986.79│   0    10G┊   0    10G│ 576B  0.23ms
1699674987.79│   0    10G┊   0    10G│ 576B  0.17ms
1699674988.79│   0    10G┊   0    10G│ 576B  0.22ms
1699674989.79│   0    10G┊   0    10G│ 576B  0.23ms
1699674990.79│   0    10G┊   0    10G│ 576B  0.24ms 
@Mai-Lapyst
Copy link
Contributor Author

Tested against master and problem still persists.

Also: If specifing the swap partions by hand output brakes as well:

$ dool --epoch --swap -S /dev/sdb4,/dev/sda4,total --aio
┄┄epoch┄┄┄┬┄┄┄┄swap┄┄┄┬async
  epoch   │ used  free│ #aio
1699676083│   0    10G┊   0    10G┊   0    20G│ 576B
1699676084│   0    10G┊   0    10G┊   0    20G│ 576B

Mai-Lapyst added a commit to Mai-Lapyst/dool that referenced this issue Nov 11, 2023
Mai-Lapyst added a commit to Mai-Lapyst/dool that referenced this issue Nov 11, 2023
@scottchiefbaker
Copy link
Owner

Very interesting... I've never worked on a system with more than one swap partition. Let me setup a test VM and do some testing.

@scottchiefbaker
Copy link
Owner

I refactored the swap code to report swap if there is only one, and the device name if there is more than one. This should be consistent with the previous naming scheme for 99% of use cases where the user only has one swap partition.

Can you test the next branch and see if it works for you? The relevant code is in dool on line 1382

@Mai-Lapyst
Copy link
Contributor Author

Can you test the next branch and see if it works for you? The relevant code is in dool on line 1382

When using next (commit 63810c2), it still produces the wrong output:

$ ./dool --epoch --full --swap --aio
┄┄epoch┄┄┄┬┄┄┄┄swap┄┄┄┬async
  epoch   │ used  free│ #aio
1700554085│   0    10G┊7572M 2667M│ 896B
1700554086│   0    10G┊7572M 2667M│ 896B 

@Mai-Lapyst
Copy link
Contributor Author

My bad; git didn't checked out the full branch;

Can confirm that using the correct commit of 30847c7 it works now:

$ ./dool --epoch --full --swap --aio
┄┄epoch┄┄┄┬┄swap/sda4┄┄┄swap/sdb4┄┬async
  epoch   │ used  free  used  free│ #aio
1700554295│   0    10G┊7571M 2668M│ 896B
1700554296│   0    10G┊7571M 2668M│ 896B

@scottchiefbaker
Copy link
Owner

Excellent... great news. That will get rolled in to the next official release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants