-
Notifications
You must be signed in to change notification settings - Fork 10
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
Expand smaps / smaps_rollup parsing #1130
Conversation
364810d
to
20dd840
Compare
88bf086
to
5aa9221
Compare
shared_clean: shared_clean.unwrap_or(0), | ||
shared_dirty: shared_dirty.unwrap_or(0), | ||
private_clean: private_clean.unwrap_or(0), | ||
private_dirty: private_dirty.unwrap_or(0), | ||
referenced: referenced.unwrap_or(0), | ||
anonymous: anonymous.unwrap_or(0), | ||
lazy_free: lazy_free.unwrap_or(0), | ||
anon_huge_pages: anon_huge_pages.unwrap_or(0), | ||
shmem_pmd_mapped: shmem_pmd_mapped.unwrap_or(0), | ||
file_pmd_mapped: file_pmd_mapped.unwrap_or(0), | ||
shared_hugetlb: shared_hugetlb.unwrap_or(0), | ||
private_hugetlb: private_hugetlb.unwrap_or(0), | ||
swap_pss: swap_pss.unwrap_or(0), | ||
locked: locked.unwrap_or(0), |
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.
Some preference towards doing the same thing with size, pss, rss, and swap
to make handling consistent unless there's a reason to have different behavior for those.
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.
Agreed, I'd like to see the required fields unwrapped similarly to how size, pss, rss
etc are unwrapped above.
Only a few of these fields are actually optional, and I don't want to report 0
incorrectly.
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.
Hmm the more I look at this the more I think the current approach is bankrupt. Best to read the whole file in, rip through it and create metrics without the intermediary structure.
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.
new approach seems good in terms of simpler code, but I'm concerned that we're blindly reporting 0 for any values that don't exist.
Unless I'm misunderstanding the code here, but it seems like we would end up reporting 0
in cases where there is no value, which makes this data confusing to work with.
lading/src/observer/linux/procfs.rs
Outdated
@@ -329,8 +355,26 @@ impl Sampler { | |||
gauge!("smaps.pss.sum", &labels).set(measures.pss as f64); | |||
gauge!("smaps.size.sum", &labels).set(measures.size as f64); | |||
gauge!("smaps.swap.sum", &labels).set(measures.swap as f64); | |||
|
|||
// This code reads smaps_rollup | |||
gauge!("smaps.shared_clean.sum", &labels).set(measures.shared_clean as f64); |
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.
I'd be open to removing the smaps.sum
fields, I think this is just duplicating what we already get from smaps_rollup
shared_clean: shared_clean.unwrap_or(0), | ||
shared_dirty: shared_dirty.unwrap_or(0), | ||
private_clean: private_clean.unwrap_or(0), | ||
private_dirty: private_dirty.unwrap_or(0), | ||
referenced: referenced.unwrap_or(0), | ||
anonymous: anonymous.unwrap_or(0), | ||
lazy_free: lazy_free.unwrap_or(0), | ||
anon_huge_pages: anon_huge_pages.unwrap_or(0), | ||
shmem_pmd_mapped: shmem_pmd_mapped.unwrap_or(0), | ||
file_pmd_mapped: file_pmd_mapped.unwrap_or(0), | ||
shared_hugetlb: shared_hugetlb.unwrap_or(0), | ||
private_hugetlb: private_hugetlb.unwrap_or(0), | ||
swap_pss: swap_pss.unwrap_or(0), | ||
locked: locked.unwrap_or(0), |
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.
Agreed, I'd like to see the required fields unwrapped similarly to how size, pss, rss
etc are unwrapped above.
Only a few of these fields are actually optional, and I don't want to report 0
incorrectly.
20dd840
to
996eaf8
Compare
1bd074a
to
5a1f0ac
Compare
3596e48
to
2ffde30
Compare
b3f9606
to
e8d0095
Compare
2ffde30
to
050e8ca
Compare
e8d0095
to
237e686
Compare
050e8ca
to
2c3fd89
Compare
237e686
to
2a09dca
Compare
52db4dc
to
bdb4dcc
Compare
2a09dca
to
e4a843b
Compare
bdb4dcc
to
08943ba
Compare
e4a843b
to
2cbeb08
Compare
This commit expands the number of fields we parse from the smaps/smaps_rollup files. I have not hooked these up yet to metrics emission but will in a follow-up commit to this PR. Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
08943ba
to
47ff608
Compare
0cb9e7e
to
7877403
Compare
Signed-off-by: Brian L. Troutwine <[email protected]>
7877403
to
89c9fb1
Compare
Merge activity
|
What does this PR do?
This commit expands the number of fields we parse from the smaps/smaps_rollup
files. I have not hooked these up yet to metrics emission but will in a follow-up
commit to this PR.