Skip to content

Commit ed07c01

Browse files
eminencejyn514
authored andcommitted
Upgrade procfs from 0.12 to 0.13
In addition to upgrading to 0.13, this also switches to a more efficient way to get the number of open file descriptors.
1 parent ec8dd33 commit ed07c01

File tree

3 files changed

+52
-5
lines changed

3 files changed

+52
-5
lines changed

Cargo.lock

Lines changed: 50 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ features = ["with-chrono-0_4", "with-serde_json-1"]
105105

106106
[target.'cfg(target_os = "linux")'.dependencies]
107107
# Process information
108-
procfs = "0.12.0"
108+
procfs = "0.13.0"
109109

110110
[dev-dependencies]
111111
criterion = "0.3"

src/metrics/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl Metrics {
179179

180180
let process = Process::myself().unwrap();
181181
self.open_file_descriptors
182-
.set(process.fd().unwrap().len() as i64);
182+
.set(process.fd_count().unwrap() as i64);
183183
self.running_threads
184184
.set(process.stat().unwrap().num_threads as i64);
185185
}

0 commit comments

Comments
 (0)