Skip to content

Commit d2a93c4

Browse files
authored
Read all cgroup v2 metrics that can be read (#1120)
### What does this PR do? This commit removes any arbitration of the cgroup v2 heirarchy for a given process. We instead read anything that can be read, looping over all cgroup files present but not following the hierarchy down. Metric names will change but they will now reflect underlying system reality.
1 parent 1c73887 commit d2a93c4

File tree

8 files changed

+834
-657
lines changed

8 files changed

+834
-657
lines changed

Cargo.lock

+2-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/lading-idle.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
generator: []
2-
3-
blackhole:
4-
- tcp:
5-
binding_addr: "0.0.0.0:8080"
2+
blackhole: []

lading/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ quanta = { version = "0.12", default-features = false, features = [] }
8787
zstd = "0.13.1"
8888

8989
[target.'cfg(target_os = "linux")'.dependencies]
90-
cgroups-rs = { version = "0.3", default-features = false, features = [] }
9190
procfs = { version = "0.17", default-features = false, features = [] }
9291
async-pidfd = "0.1"
9392

lading/src/observer.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ impl Server {
112112
let target_pid = target_pid.expect("observer cannot be used in no-target mode");
113113

114114
let mut sample_delay = tokio::time::interval(Duration::from_secs(1));
115-
let mut sampler = Sampler::new(target_pid)?;
115+
let mut sampler = Sampler::new(
116+
target_pid,
117+
vec![(String::from("focus"), String::from("target"))],
118+
)?;
116119

117120
let shutdown_wait = self.shutdown.recv();
118121
tokio::pin!(shutdown_wait);

0 commit comments

Comments
 (0)