-
Notifications
You must be signed in to change notification settings - Fork 1.2k
add option to collect the count of active memory maps for linux processes #2454
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
Conversation
src/processes.c
Outdated
@@ -738,7 +752,7 @@ static void ps_submit_proc_list(procstat_t *ps) { | |||
plugin_dispatch_values(&vl); | |||
|
|||
if ((ps->io_rchar != -1) && (ps->io_wchar != -1)) { | |||
sstrncpy(vl.type, "io_octets", sizeof(vl.type)); | |||
sstrncpy(vl.type, "ps_disk_octets", sizeof(vl.type)); |
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.. Looks as an unrelated change.
src/processes.c
Outdated
@@ -761,13 +775,20 @@ static void ps_submit_proc_list(procstat_t *ps) { | |||
plugin_dispatch_values(&vl); | |||
} | |||
|
|||
if (ps->num_fd > 0) { | |||
if (ps->num_fd > 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.
This change also unneeded.
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 like to note that clang-format has the final say in this. I'd say it would undo this change.
src/collectd.conf.in
Outdated
@@ -1170,6 +1170,7 @@ | |||
#<Plugin processes> | |||
# CollectFileDescriptor true | |||
# CollectContextSwitch true | |||
# CollectMemoryMaps true |
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.
Please, fix indent.
Hi! Thanks for your work. I want to notice, you missed adding documentation for a new option. |
src/types.db
Outdated
@@ -129,6 +129,7 @@ latency value:GAUGE:0:U | |||
links value:GAUGE:0:U | |||
load shortterm:GAUGE:0:5000, midterm:GAUGE:0:5000, longterm:GAUGE:0:5000 | |||
memory_bandwidth value:DERIVE:0:U | |||
memory_maps value:GAUGE:0:U |
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.
Would the existing file_handles
type also work? E.g. as "memory/file_handles-mapped"?
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.
Ah, I've added this to make it appear on top level in a descriptive name. How would I reference the file_handles type to achieve this?
Thanks @dothebart for submitting this! |
src/processes.c
Outdated
@@ -768,6 +782,13 @@ static void ps_submit_proc_list(procstat_t *ps) { | |||
plugin_dispatch_values(&vl); | |||
} | |||
|
|||
if (ps->num_maps > 0) { | |||
sstrncpy(vl.type, "memory_maps", sizeof(vl.type)); |
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.
How would I reference the file_handles type to achieve this?
To use the existing file_handles
type:
sstrncpy(vl.type, "file_handles", sizeof(vl.type));
sstrncpy(vl.type_instance, "mapped", sizeof(vl.type_instance));
|
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.
LGTM, thanks @dothebart!
any hints on a timeframe when this will occur in a release? weeks? months? |
Weeks. We plan to release 5.8 this year, likely first half of December. |
In linux the maximum count of memory mapped files is configured via
/proc/sys/vm/max_map_count
which is 65530 by default.With bigger machines that are capable of running many application threads this may quickly become a sparse resource - therefore I'd like to be able to track it.