[SERVER-25143] Output disk read and write metrics in system-independent units Created: 19/Jul/16  Updated: 04/Aug/16  Resolved: 01/Aug/16

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Bruce Lucas (Inactive) Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 18 (08/05/16)
Participants:

 Description   

The new system metric diagnostic data for disks has "read_sectors" and "write_sectors", but "sector" is a system-specific unit, and can possibly vary between filesystems. This field should be converted to a non-system-specific unit, preferably bytes.



 Comments   
Comment by Bruce Lucas (Inactive) [ 01/Aug/16 ]

OK, thanks for tracking that all down; "sectors" will do.

Comment by Mark Benvenuto [ 01/Aug/16 ]

The "sectors" that are listed in the disk data come from /proc/diskstats. These same counters can be found in /sys/block/<x>/stat. The "sectors" field is in system-independent 512 byte increments. It is a simple transformation to multiple sectors by 512 in order to return bytes. To quote the documentation:

read sectors, write sectors
===========================

These values count the number of sectors read from or written to this
block device. The "sectors" in question are the standard UNIX 512-byte
sectors, not any device- or filesystem-specific block size. The
counters are incremented when the I/O completes.

Documentation:
http://lxr.free-electrons.com/source/Documentation/block/stat.txt#L49

Source:
/sys/block/<x>/stat: http://lxr.free-electrons.com/source/block/partition-generic.c#L112
/proc/diskstats: http://lxr.free-electrons.com/source/block/genhd.c#L1177

Shift the code does:
http://lxr.free-electrons.com/source/include/linux/bio.h#L99

Generated at Thu Feb 08 04:08:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.