8000 processes: Show real disk IO in addition to process IO (Linux only) by rpv-tomsk · Pull Request #2232 · collectd/collectd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

processes: Show real disk IO in addition to process IO (Linux only) #2232

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 20, 2017

Conversation

rpv-tomsk
Copy link
Contributor
@rpv-tomsk rpv-tomsk commented Mar 29, 2017

Collectd reports /proc/PID/io fields io_rchar/io_wchar as ps_disk_octets type and io_syscr/io_syscw as ps_disk_ops type.
The names of these types do not match values they represent.

  1. For io_rchar/io_wchar data type should be named as ps_io_octets. In Linux, these values represent any I/O of process, not disk I/O only: they include sockets, pipes, console I/O, etc.
    The ps_io_octets type can be added in addition to the existing ps_disk_octets for which values can be obtained from read_bytes/write_bytes of /proc/PID/io. These values will be much more correct for reporting as ps_disk_octets than existing io_rchar/io_wchar. Please note what read_bytes/write_bytes is real disk I/O, it does not account file I/O from cache.

  2. For io_syscr/io_syscw correct type should be named ps_io_ops.
    Reported values do not match any real disk ops.

My proposal is to fix these issues.

New, correct mapping implemented:

 io_rchar/io_wchar      -> ps_io_octets   (renamed from ps_disk_octets)
 io_syscr/io_syscw      -> ps_io_ops      (renamed from ps_disk_ops)
 read_bytes/write_bytes -> ps_disk_octets (new data collected to existing type)

Related documentation: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/proc.txt?id=HEAD#n1558

Issues: #1990, #1225

8000
@ggrossetie
Copy link

This looks good to me 👍
Thanks for the link on the documentation.

The only "breaking change" is that ps_disk_ops will not be reported anymore but I think that's fine because the reported value was incorrect (arguably a bug fix).
If we really want backward compatibility we could continue to report this value (even if the value don't match the label).

@octo octo added the Feature label May 17, 2017
Copy link
Member
@octo octo left a comment

Choose a reason for hiding this comment

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

Hi @rpv-tomsk, thank you very much for your patch! I think it is reasonable, but should be part of a feature release, not a patch release.

The ps_ prefix of the types used by the processes plugin are an annoying legacy and I'd prefer not to introduce additional types with that prefix. Could we please use the following mapping instead:

 io_rchar/io_wchar      -> io_octets      (renamed from ps_disk_octets)
 io_syscr/io_syscw      -> io_ops         (renamed from ps_disk_ops)
 read_bytes/write_bytes -> ps_disk_octets (new data collected to existing type)

Where io_ops is a new type and io_octets is an existing type. I'm a bit undecided between using ps_disk_octets (don't break existing metrics) and switching to disk_octets (data will be different, might as well use a new type). What do you think?

The code itself is flawless. Thank you! :-D
—octo

@PhilippWendler
Copy link

If the data is different, shouldn't a new name be used anyway, to make sure that it won't be confused with old data? Then a new type can be used, too.

@octo octo self-assigned this May 19, 2017
@rpv-tomsk rpv-tomsk force-pushed the processes branch 2 times, most recently from 143422b to 7c6486a Compare July 5, 2017 12:21
@rpv-tomsk
Copy link
Contributor Author

Types renamed.

New mapping implemented:

 io_rchar/io_wchar      -> io_octets   (renamed from ps_disk_octets)
 io_syscr/io_syscw      -> io_ops      (renamed from ps_disk_ops)
 read_bytes/write_bytes -> disk_octets (new data collected)

Obsolete datatypes, not used anymore:

 ps_disk_octets
 ps_disk_ops

Before this patch, Collectd reports /proc/PID/io fields 'io_rchar/io_wchar' as
'ps_disk_octets' type and 'io_syscr/io_syscw' as 'ps_disk_ops' type.
The names of these types do not match values they represent.

New, correct mapping implemented:

 io_rchar/io_wchar      -> io_octets   (was ps_disk_octets, not used anymore)
 io_syscr/io_syscw      -> io_ops      (was ps_disk_ops, not used anymore)
 read_bytes/write_bytes -> disk_octets (new data collected)

 Closes: collectd#1990
@octo octo merged commit af12cc4 into collectd:master Jul 20, 2017
@octo octo added this to the 5.8 milestone Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0