Re: bgwriter stats - Mailing list pgsql-patches

From Tom Lane
Subject Re: bgwriter stats
Date
Msg-id 18157.1174343532@sss.pgh.pa.us
Whole thread Raw
In response to bgwriter stats  (Magnus Hagander <magnus@hagander.net>)
Responses Re: bgwriter stats  (Darcy Buskermolen <darcy@ok-connect.com>)
Re: bgwriter stats  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
Magnus Hagander <magnus@hagander.net> writes:
> 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?

This seems quite a bizarre way to do things.  Why wouldn't you implement
this functionality by shipping messages to the stats collector?

            regards, tom lane

pgsql-patches by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: bgwriter stats
Next
From: Tom Lane
Date:
Subject: Re: bgwriter stats