Re: Make pg_stat_io view count IOs as bytes instead of blocks
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Nazir Bilal Yavuz <byavuz81@gmail.com>, Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, Melanie Plageman <melanieplageman@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-01-16T05:43:43Z
Lists: pgsql-hackers
On Thu, Jan 16, 2025 at 12:18:38AM -0500, Tom Lane wrote: > However, the macro does provide a convenient place to hang the > warning comment about keeping it sync'd with the enum. > Personally I'd keep the macro but move it to pgstat.h, close > to the enum declaration, so that there's more than epsilon > chance of someone who's changing the enum noticing they need > to update it. Not completely sure about the number of parenthesis, but I hope that this should be enough (extra set around io_op): +#define pgstat_is_ioop_tracked_in_bytes(io_op) \ + (((unsigned int) (io_op)) < IOOP_NUM_TYPES && \ + ((unsigned int) (io_op)) >= IOOP_EXTEND) -- Michael
Commits
-
Rework macro pgstat_is_ioop_tracked_in_bytes()
- 7b6468cc9523 18.0 landed
-
Remove assertion in pgstat_count_io_op()
- d2181b321852 18.0 landed
-
Make pg_stat_io count IOs as bytes instead of blocks for some operations
- f92c854cf406 18.0 landed
-
Merge pgstat_count_io_op_n() and pgstat_count_io_op()
- f0bf7857befe 18.0 landed