From 8e90ec5580d5345fef31005d7cc2215ba2125070 Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Thu, 29 Oct 2020 09:11:51 +0530 Subject: Track statistics for streaming of changes from ReorderBuffer. This adds the statistics about transactions streamed to the decoding output plugin from ReorderBuffer. Users can query the pg_stat_replication_slots view to check these stats and call pg_stat_reset_replication_slot to reset the stats of a particular slot. Users can pass NULL in pg_stat_reset_replication_slot to reset stats of all the slots. Commit 9868167500 has added the basic infrastructure to capture the stats of slot and this commit extends the statistics collector to track additional information about slots. Bump the catversion as we have added new columns in the catalog entry. Author: Ajin Cherian and Amit Kapila Reviewed-by: Sawada Masahiko and Dilip Kumar Discussion: https://postgr.es/m/CAA4eK1+chpEomLzgSoky-D31qev19AmECNiEAietPQUGEFhtVA@mail.gmail.com --- doc/src/sgml/monitoring.sgml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 313e44ed549..98e19954538 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -2632,6 +2632,44 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i + + + stream_txns bigint + + + Number of in-progress transactions streamed to the decoding output plugin + after the memory used by logical decoding of changes from WAL for this + slot exceeds logical_decoding_work_mem. Streaming only + works with toplevel transactions (subtransactions can't be streamed + independently), so the counter does not get incremented for subtransactions. + + + + + + stream_countbigint + + + Number of times in-progress transactions were streamed to the decoding + output plugin while decoding changes from WAL for this slot. Transactions + may get streamed repeatedly, and this counter gets incremented on every + such invocation. + + + + + + stream_bytesbigint + + + Amount of decoded in-progress transaction data streamed to the decoding + output plugin while decoding changes from WAL for this slot. This and other + streaming counters for this slot can be used to gauge the network I/O which + occurred during logical decoding and allow tuning logical_decoding_work_mem. + + + + stats_reset timestamp with time zone -- cgit v1.2.3