Skip to content

Commit a4c60ff

Browse files
authored
Switch to more efficient fd_count() for process_open_fds (#357)
Signed-off-by: Ivan Babrou <[email protected]>
1 parent 9aa84bd commit a4c60ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/process_collector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ impl Collector for ProcessCollector {
132132
};
133133

134134
// file descriptors
135-
if let Ok(fd_list) = p.fd() {
136-
self.open_fds.set(fd_list.len() as f64);
135+
if let Ok(fd_count) = p.fd_count() {
136+
self.open_fds.set(fd_count as f64);
137137
}
138138
if let Ok(limits) = p.limits() {
139139
if let procfs::process::LimitValue::Value(max) = limits.max_open_files.soft_limit {

0 commit comments

Comments
 (0)