Re: Report bytes and transactions actually sent downtream - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Report bytes and transactions actually sent downtream
Date
Msg-id CAA4eK1LxKLPh_m-PRh44Br1NMd0vEua9O-R0O+gW7Wj25Zkarg@mail.gmail.com
Whole thread Raw
In response to Re: Report bytes and transactions actually sent downtream  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Mon, Mar 16, 2026 at 4:40 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Mon, Mar 16, 2026 at 1:21 PM Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
> >
> > 1) v20260316-0001-Report-downstream-sent-bytes-in-pg_stat_replication_.patch:
> >
> > This patch introduces sent_bytes to report the amount of data sent
> > downstream. It documents sent_bytes in a way that it clarifies how
> > sent_bytes differs from total_bytes, without modifying the existing
> > documentation for total_bytes or total_txns. The patch is purely
> > additive and does not alter any existing documentation.
> >
>
> *
> +        <structfield>sent_bytes</structfield><type>bigint</type>
> +       </para>
> +       <para>
> +        Amount of transaction changes sent downstream for this slot by the
> +        output plugin after applying output plugin filters, if any, and
> +        converting it into the output plugin format.
>
> BTW, this also contains changes from pgoutput_message() which could be
> non-transactional. So, saying transaction changes may not be
> appropriate.
>
> * We also send keep_alive kind of messages via wal_sender, those are
> not counted in sent_bytes.
>

I think the other one to consider in the same category is the
PqMsg_CopyDone message.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Avoid resource leak (contrib/postgres_fdw/connection.c)
Next
From: Alena Rybakina
Date:
Subject: Re: Vacuum statistics