Skip to content

Supports collection of process shared memory #719

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

Merged
merged 1 commit into from
Jul 3, 2025

Conversation

SilenceAdele
Copy link
Contributor

  • Parse process memory usage from /proc/[pid]/statm into ProcStatm struct.
  • Add unit tests for proc_statm.
  • Add /proc/26231/statm test data to fixtures.

@SilenceAdele
Copy link
Contributor Author

/cc @kakkoyun @discordianfish

@SilenceAdele
Copy link
Contributor Author

/cc @SuperQ

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

proc_statm.go Outdated

// - https://man7.org/linux/man-pages/man5/proc_pid_statm.5.html

// ProcStatm provides memory usage information for a process, measured in memory pages.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ProcStatm provides memory usage information for a process, measured in memory pages.
// ProcStatm Provides memory usage information for a process, measured in memory pages.

Copy link
Contributor Author

@SilenceAdele SilenceAdele May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/SilenceAdele/procfs/compare/b1487ea..72849ee

@SuperQ ok, I have been modified it. Thanks for your review.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @SuperQ

Copy link
Contributor Author

@SilenceAdele SilenceAdele Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @SuperQ @ncabatoff Would it be possible to merge this PR? I'm planning to reference procfs in process-exporter to implement process shared memory metrics, and this PR provides the necessary support for that.

* Parse process memory usage from /proc/[pid]/statm
  into ProcStatm struct.
* Add unit tests for proc_statm.
* Add /proc/26231/statm test data to fixtures.

Signed-off-by: zhiyuan.zhou <zhiyuan.zhou@easystack.cn>
@SuperQ SuperQ merged commit 28d508d into prometheus:master Jul 3, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants