Skip to content

Supports collection of process shared memory - #719

Merged
SuperQ merged 1 commit into
prometheus:masterfrom
SilenceAdele:685
Jul 3, 2025
Merged

SuperQ merged 1 commit into
prometheus:masterfrom
SilenceAdele:685

Conversation

@SilenceAdele

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

/cc @kakkoyun @discordianfish

@SilenceAdele

Copy link
Copy Markdown
Contributor Author

/cc @SuperQ

@SuperQ SuperQ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

Comment thread 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
Copy Markdown
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.

@SilenceAdele SilenceAdele May 22, 2025 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

/cc @SuperQ

@SilenceAdele SilenceAdele Jul 3, 2025 •

Copy link
Copy Markdown
Contributor Author

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>
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