bashtop icon indicating copy to clipboard operation
bashtop copied to clipboard

[REQUEST] Add zram info

Open perkinslr opened this issue 5 years ago • 2 comments

Describe the solution you'd like ZRam is a compressed page subsystem, used for ramdisks and swap. I'd like the information from zramctl included when there are zram devices in use. I've added it below mem to my local copy (and can provide that implementation if you like), but getting it in upstream, and written better than I did would be nice.

perkinslr avatar May 20 '20 23:05 perkinslr

Feel free to make a pull request and I will take a look at it. Though it's likely this information would get cut off by size constraints if a swap file is also present.

aristocratos avatar May 23 '20 00:05 aristocratos

Done, PR #122 I'm not normally a Bash programmer, so I strongly suspect you'll want to extract the logic and do it "right", I tried to copy the style of the rest of the code, but suspect it's not quite right.

That said, I did account for the variable placement from Swap (especially since zram is most commonly used as a swap device). It takes 20 lines in the mem region to display properly if swap is included, 14 otherwise (and that's for a single zram device, which is probably the most common configuration). It's probably possible to drop it to 1 or 2 lines per device, keeping only the compressed size line, as that's the most important.

perkinslr avatar May 23 '20 00:05 perkinslr