Implement IOCountersWithContext for AIX with CGO#2016
Conversation
shirou
left a comment
There was a problem hiding this comment.
Thanks for the implementation. I checked the perfstat source and have a few questions:
- Unit of
d.Time: The comment says "Time is already in milliseconds", but the perfstatDisk.Timecomment only says "amount of time disk is active" without specifying the unit. Have you confirmed thatdk_timeis in milliseconds from the IBMperfstat_disk_tdocumentation? It seems inconsistent thatRserv/Wservare in nanoseconds while Time is in milliseconds. - Unit of
Rserv/Wserv/WqTime: These are converted as nanoseconds, but could you confirm this from the IBM documentation? They might be in microseconds instead. QDepth: Theperfstat.Diskstruct has aQDepthfield ("instantaneous service queue depth"). Could you map it toIopsInProgress?
IopsInProgress: uint64(d.QDepth),
|
To be honest the documentation is somewhat lacking so it comes from experimentation...
I ran a program which writes to a file (without buffering) for 10 seconds, it also gets I also ran I updated the PR. See
Two measures with a 10s sleep in between: The deltas are Running There are 35996 transfers (all writes), so the average time per write is 3119361338/35996=86658, which is only somewhat coherent with Again I'm sorry I don't have much stronger arguments than that, the documentation is unfortunately not explicit so running things and comparing values is the best I can do.
|
shirou
left a comment
There was a problem hiding this comment.
Thank you for the thorough investigation! The experimental data convincingly confirms:
- Time is in kernel ticks (using
sysconf(_SC_CLK_TCK)to convert is the right approach) Rserv/Wserv/WqTimeare in nanosecondsQDepthmapping toIopsInProgressadded
Implement
IOCountersWithContextfor AIX with CGO.Uses the disk info from github.com/power-devops/perfstat (already used by other functions).
https://github.com/power-devops/perfstat/blob/main/types_disk.go