Track IO times in pg_stat_io
authorAndres Freund <[email protected]>
Fri, 7 Apr 2023 23:05:26 +0000 (16:05 -0700)
committerAndres Freund <[email protected]>
Sat, 8 Apr 2023 00:04:56 +0000 (17:04 -0700)
commitac8d53dae5ae2914aeb022dc514826f71c7206e6
tree04720e046622d3676452a9f4d6aa655820fbf8d8
parent1c453cfd8976d9c6451ba45e27bf30375d574312
Track IO times in pg_stat_io

a9c70b46dbe and 8aaa04b32S added counting of IO operations to a new view,
pg_stat_io. Now, add IO timing for reads, writes, extends, and fsyncs to
pg_stat_io as well.

This combines the tracking for pgBufferUsage with the tracking for pg_stat_io
into a new function pgstat_count_io_op_time(). This should make it a bit
easier to avoid the somewhat costly instr_time conversion done for
pgBufferUsage.

Author: Melanie Plageman <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Reviewed-by: Bertrand Drouvot <[email protected]>
Discussion: https://postgr.es/m/flat/CAAKRu_ay5iKmnbXZ3DsauViF3eMxu4m1oNnJXqV_HyqYeg55Ww%40mail.gmail.com
doc/src/sgml/monitoring.sgml
src/backend/catalog/system_views.sql
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/localbuf.c
src/backend/storage/smgr/md.c
src/backend/utils/activity/pgstat_io.c
src/backend/utils/adt/pgstatfuncs.c
src/include/catalog/pg_proc.dat
src/include/pgstat.h
src/test/regress/expected/rules.out
src/tools/pgindent/typedefs.list