j-schulz / p5-Sys-Statistics-Linux

Front-end module to collect system statistics
Other
1 stars 0 forks source link

support for read, write response time from diskstats #2

Open sparvu opened 9 years ago

sparvu commented 9 years ago

We need to be able to report per disk or overall all disks the time spent in reading, writing. We need to support the following fields from diskstats file:

   7 - time spent reading (ms)
  11 - time spent writing (ms)
  13 - time spent doing I/Os (ms)
  14 - weighted time spent doing I/Os (ms)

https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats

sparvu commented 9 years ago

Explanation:

Field 7 "The number of milliseconds spent reading. This counts only reads that have completed, not reads that are in progress. It counts the time spent from when requests are placed on the queue until they complete, not the time that the underlying disk spends servicing the requests. That is, it measures the total response time seen by applications, not disk response times." (source: pt-diskstats from percona)

Field 11 same as field 7 but for writes

Field 13 "The total number of milliseconds spent doing I/Os. This is not the total response time seen by the applications; it is the total amount of time during which at least one I/O was in progress. If one I/O is issued at time 100, another comes in at 101, and both of them complete at 102, then this field increments by 2, not 3." (source: pt-diskstats from percona)

Field 14 "This field counts the total response time of all I/Os. In contrast to field 13, it counts double when two I/Os overlap. In our previous example, this field would increment by 3, not 2." (source: pt-diskstats from percona)

sparvu commented 9 years ago

After adding these metrics we could basically report as well:

http://manpages.ubuntu.com/manpages/saucy/man1/pt-diskstats.1p.html