Skip to content

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.

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 <[email protected]>
@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