htop icon indicating copy to clipboard operation
htop copied to clipboard

PCP: add File Descriptor Meter

Open smalinux opened this issue 2 years ago • 8 comments

Related: #990

Signed-off-by: Sohaib Mohamed [email protected]

smalinux avatar May 04 '22 08:05 smalinux

You can get the same info from /proc/sys/fs/file-nr on a Linux system (#990). BSD has sysctl kern.maxfiles and sysctl kern.openfiles. Why not implement it to work outside PCP as well?

fasterit avatar May 04 '22 10:05 fasterit

You can get the same info from /proc/sys/fs/file-nr on a Linux system (#990). BSD has sysctl kern.maxfiles and sysctl kern.openfiles. Why not implement it to work outside PCP as well?

I'm not sure what you mean @fasterit ... ? @BenBE has already implemented it "outside of PCP" for Linux, and has started on the BSD code AIUI - meanwhile this code from @smalinux using the (existing) PCP metrics looks on the right path to me for the PCP backend.

natoscott avatar May 04 '22 10:05 natoscott

@fasterit That is a good idea, but the problem with this way is that it always assumes that the information will be available live all the time. In the PCP case, on the other hand, it does not assume that. PCP could read this data from some archive logs or be read from another target machine. That's the power of PCP: https://pcp.readthedocs.io/en/latest/UAG/IntroductionToPcp.html

smalinux avatar May 04 '22 10:05 smalinux

@smalinux looks like you have a build failure there?

natoscott avatar May 04 '22 10:05 natoscott

@natoscott yes, because #990 is still not merged yet and there is no FileDescriptorMeter.ch I tested it and after adding it to myhtopsources will work perfectly :)

smalinux avatar May 04 '22 10:05 smalinux

You can get the same info from /proc/sys/fs/file-nr on a Linux system (#990). BSD has sysctl kern.maxfiles and sysctl kern.openfiles. Why not implement it to work outside PCP as well?

I'm not sure what you mean @fasterit ... ? @BenBE has already implemented it "outside of PCP" for Linux, and has started on the BSD code AIUI - meanwhile this code from @smalinux using the (existing) PCP metrics looks on the right path to me for the PCP backend.

I meant to make sure we have the same meter on all (supported) platforms.

fasterit avatar May 04 '22 11:05 fasterit

@natoscott yes, because #990 is still not merged yet […]

Just rebase onto my branch …

BenBE avatar May 04 '22 14:05 BenBE

@natoscott yes, because #990 is still not merged yet […]

Just rebase onto my branch …

Done.

smalinux avatar May 04 '22 16:05 smalinux

This PR was closed by #990 (https://github.com/htop-dev/htop/commit/bdb63a497beeb4b317296ca123c507233a2af889)

smalinux avatar Mar 24 '23 23:03 smalinux