pgstat: stats added in ReadPageInternal() aren't getting reported via pg_stat_wal - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject pgstat: stats added in ReadPageInternal() aren't getting reported via pg_stat_wal
Date
Msg-id CALj2ACVyWceviH4T-SLDVG4CmYpV9DAaWoyDKmWZXLiHRF5Qjg@mail.gmail.com
Whole thread Raw
Responses Re: pgstat: stats added in ReadPageInternal() aren't getting reported via pg_stat_wal
List pgsql-hackers
Hi,

I added xlogreader cache stats (hits/misses) to pg_stat_wal in
ReadPageInternal() for some of my work and ran some tests with logical
replication subscribers. I had expected that the new stats generated
by walsenders serving the subscribers would be accumulated and shown
via pg_stat_wal view in another session, but that didn't happen. Upon
looking around, I thought adding
pgstat_flush_wal()/pgstat_report_wal() around proc_exit() in
walsener.c might work, but that didn't help either. Can anyone please
let me know why the stats that I added aren't shown via pg_stat_wal
view despite the walsender doing pgstat_initialize() ->
pgstat_init_wal()? Am I missing something?

I'm attaching here with the patch that I was using.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment

pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)
Next
From: Robert Haas
Date:
Subject: Re: cataloguing NOT NULL constraints