Satoshi Nagayasu escribió:
> With this patch, walwriter process and each backend process
> would sum up dirty writes, and send it to the stat collector.
> So, the value could be saved in the stat file, and could be
> kept on restarting.
>
> The statistics could be retreive with using
> pg_stat_get_xlog_dirty_writes() function, and could be reset
> with calling pg_stat_reset_shared('walwriter').
>
> Now, I have one concern.
>
> The reset time could be captured in globalStats.stat_reset_timestamp,
> but this value is the same with the bgwriter one.
>
> So, once pg_stat_reset_shared('walwriter') is called,
> stats_reset column in pg_stat_bgwriter does represent
> the reset time for walwriter, not for bgwriter.
>
> How should we handle this? Should we split this value?
> And should we have new system view for walwriter?
I think the answer to the two last questions is yes. It doesn't seem to
make sense, to me, to have a single reset timings for what are
effectively two separate things.
Please submit an updated patch to next CF. I'm marking this one
returned with feedback. Thanks.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services