-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cgroup: collect pid & blkio info #36
Conversation
crates/shim/src/cgroup.rs
Outdated
@@ -114,6 +114,39 @@ pub fn collect_metrics(pid: u32) -> Result<Metrics> { | |||
// to make it easy, fill the necessary metrics only. | |||
for sub_system in Cgroup::subsystems(&cgroup) { | |||
match sub_system { | |||
Subsystem::Pid(pid_ctr) => { | |||
let mut pid_stat = metrics.pids.take().unwrap_or_default(); | |||
pid_stat.current = pid_ctr.get_pid_current().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should use "?" instead of unwrap
crates/shim/src/cgroup.rs
Outdated
Subsystem::Pid(pid_ctr) => { | ||
let mut pid_stat = metrics.pids.take().unwrap_or_default(); | ||
pid_stat.current = pid_ctr.get_pid_current().unwrap(); | ||
match pid_ctr.get_pid_max().unwrap() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as line 119
crates/shim/src/cgroup.rs
Outdated
} | ||
Subsystem::BlkIo(blkio_ctr) => { | ||
let mut pid_stat = metrics.blkio.take().unwrap_or_default(); | ||
let mut io_service_bytes_recursive: Vec<BlkIOEntry> = Vec::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra white spaces
Signed-off-by: kamizjw <[email protected]>
No description provided.