1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

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
This commit is contained in:
Amit Kapila
2021-04-16 07:34:43 +05:30
parent 1bf946bd43
commit f5fc2f5b23
15 changed files with 256 additions and 52 deletions

View File

@@ -2716,6 +2716,31 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
<structfield>total_txns</structfield> <type>bigint</type>
</para>
<para>
Number of decoded transactions sent to the decoding output plugin for
this slot. This counter is used to maintain the top level transactions,
so the counter is not incremented for subtransactions. Note that this
includes the transactions that are streamed and/or spilled.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
<structfield>total_bytes</structfield><type>bigint</type>
</para>
<para>
Amount of decoded transactions data sent to the decoding output plugin
while decoding the changes from WAL for this slot. This can be used to
gauge the total amount of data sent during logical decoding. Note that
this includes the data that is streamed and/or spilled.
</para>
</entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
<structfield>stats_reset</structfield> <type>timestamp with time zone</type>