bgwriter stats

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: PGSQL-Patches <pgsql-patches(at)postgresql(dot)org>
Subject: bgwriter stats
Date: 2007-03-19 19:44:44
Message-ID: 45FEE82C.8060205@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

I want to be able to pull some stats out of the bgwriter to be able to
track things. One thing is the total number of buffers written out.
Other things are the "number of checkpoints" and such.

Anyway. Attached patch adds this to the bgwriter shared memory. Is it
safe to do this, and then just have a regular function running in a
normal backend pulling out the value and returning it to the user,
without locking? Given that only the bgwriter can write to it?

Patch of course entirely incomplete, just illustrating the main approach
I've been thinking of taking. Just want to get this question asked and
answered before I go ahead and code more...

//Magnus

Attachment Content-Type Size
bgwrite_stat.patch text/plain 3.1 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2007-03-19 19:57:54 Re: bgwriter stats
Previous Message Magnus Hagander 2007-03-19 18:35:59 Win32 shmem