Re: Creating a function for exposing memory usage of backend process
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: torikoshia <torikoshia@oss.nttdata.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Robert Haas <robertmhaas@gmail.com>, Kasahara Tatsuhito <kasahara.tatsuhito@gmail.com>, Andres Freund <andres@anarazel.de>
Date: 2020-08-19T13:55:45Z
Lists: pgsql-hackers
On Wed, Aug 19, 2020 at 06:12:02PM +0900, Fujii Masao wrote: > On 2020/08/19 17:40, torikoshia wrote: >> Yes, I didn't add regression tests because of the unstability of the output. >> I thought it would be OK since other views like pg_stat_slru and pg_shmem_allocations >> didn't have tests for their outputs. > > You're right. If you can make a test with something minimal and with a stable output, adding a test is helpful IMO, or how can you make easily sure that this does not get broken, particularly in the event of future refactorings, or even with platform-dependent behaviors? By the way, I was looking at the code that has been committed, and I think that it is awkward to have a SQL function in mcxt.c, which is a rather low-level interface. I think that this new code should be moved to its own file, one suggestion for a location I have being src/backend/utils/adt/mcxtfuncs.c. -- Michael
Commits
-
Add regression test for pg_backend_memory_contexts.
- adc8fc6167aa 14.0 landed
-
Move codes for pg_backend_memory_contexts from mmgr/mcxt.c to adt/mcxtfuncs.c.
- 50db5964ee33 14.0 landed
-
Prevent non-superusers from reading pg_backend_memory_contexts, by default.
- 29dd6d8bc631 14.0 landed
-
Add pg_backend_memory_contexts system view.
- 3e98c0bafb28 14.0 landed
-
Fix yet another issue with step generation in partition pruning.
- 199cec977950 14.0 cited