Re: Add new option 'all' to pg_stat_reset_shared()

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: torikoshia <torikoshia@oss.nttdata.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Andres Freund <andres@anarazel.de>, boekewurm+postgres@gmail.com, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, pgsql-hackers@postgresql.org
Date: 2023-11-09T01:25:18Z
Lists: pgsql-hackers
On Thu, Nov 09, 2023 at 10:10:39AM +0900, torikoshia wrote:
> I am a little concerned about that the reset time is not the same and that
> GetCurrentTimestamp() is called multiple times, but I think it would be
> acceptable because the function is probably not used that often and the
> reset time is not atomic in practice.

Arf, right.  I misremembered that this is just a clock_timestamp() so
that's not transaction-resilient.  Anyway, my take is that this is not
a big deal in practice compared to the usability of the wrapper.
--
Michael

Commits

  1. Add target "slru" to pg_stat_reset_shared()

  2. doc: Improve description of targets for pg_stat_reset_shared()

  3. Add support for pg_stat_reset_slru without argument

  4. Add ability to reset all shared stats types in pg_stat_reset_shared()