Skip to content

Add file descriptor (nfds) monitoring to countmon - #320

Open
mohitt31 wants to merge 1 commit into
HSF:mainfrom
mohitt31:add-nfds-monitoring
Open

Add file descriptor (nfds) monitoring to countmon#320
mohitt31 wants to merge 1 commit into
HSF:mainfrom
mohitt31:add-nfds-monitoring

Conversation

@mohitt31

@mohitt31 mohitt31 commented Sep 8, 2026

Copy link
Copy Markdown

This adds the number of open file descriptors to countmon, alongside the process and thread counts it already tracks. For each monitored process it counts the entries under /proc/[pid]/fd and sums them, and keeps the peak like the other count metrics.

It follows the same shape as the existing nthreads handling, so the new value shows up as nfds in the text and JSON output with a matching max in the totals. number_of_fds is an unsigned long long to stay consistent with the other counts.

For the tests I added a countmon case to test_values that runs against precooked /proc data with 3, 5 and 2 descriptors across three iterations and checks both the per-iteration values and that the peak comes out as 5. There is also a small addition to test_count.py for the integration side.

Count open file descriptors per process by enumerating /proc/PID/fd
entries, aggregated across the monitored process tree. This is useful
for detecting file descriptor leaks in long-running HEP workflows.

The metric is non-monotonic (fd count can rise and fall), so peak and
average values are tracked in the JSON summary.

Includes unit tests with precooked test data (3 iterations testing
rise and fall of fd count) and an integration test update to
test_count.py verifying a minimum fd count per process.
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

Successfully merging this pull request may close these issues.

1 participant