Thread: pgsql: Add information of total data processed to replication slot stat
Add information of total data processed to replication slot stats. This adds the statistics about total transactions count and total transaction data logically sent to the decoding output plugin from ReorderBuffer. Users can query the pg_stat_replication_slots view to check these stats. Suggested-by: Andres Freund Author: Vignesh C and Amit Kapila Reviewed-by: Sawada Masahiko, Amit Kapila Discussion: https://postgr.es/m/20210319185247.ldebgpdaxsowiflw@alap3.anarazel.de Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/f5fc2f5b23d1b1dff60f8ca5dc211161df47eda4 Modified Files -------------- contrib/test_decoding/Makefile | 2 + contrib/test_decoding/expected/stats.out | 79 ++++++++++++++++++------- contrib/test_decoding/sql/stats.sql | 48 ++++++++++----- contrib/test_decoding/t/001_repl_stats.pl | 76 ++++++++++++++++++++++++ doc/src/sgml/monitoring.sgml | 25 ++++++++ src/backend/catalog/system_views.sql | 2 + src/backend/postmaster/pgstat.c | 6 ++ src/backend/replication/logical/logical.c | 18 +++--- src/backend/replication/logical/reorderbuffer.c | 21 +++++++ src/backend/utils/adt/pgstatfuncs.c | 8 ++- src/include/catalog/catversion.h | 2 +- src/include/catalog/pg_proc.dat | 6 +- src/include/pgstat.h | 4 ++ src/include/replication/reorderbuffer.h | 7 +++ src/test/regress/expected/rules.out | 4 +- 15 files changed, 256 insertions(+), 52 deletions(-)