Skip site navigation (1) Skip section navigation (2)

Re: Clearing global statistics

From: Rafael Martinez <r(dot)m(dot)guerrero(at)usit(dot)uio(dot)no>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Clearing global statistics
Date: 2010-01-14 21:04:23
Message-ID: 4B4F86D7.8070802@usit.uio.no (view raw or flat)
Thread:
Lists: pgsql-hackers
Greg Smith wrote:
> 
>> Before 8.3, we had the stats_reset_on_server_start parameter and
>> the pg_postmaster_start_time() function. This was an easy way of
>> resetting *all* statistics delivered by pg_stat_* and knowing when
>> this was done. We were able to produce stats with information about
>> sec/hours/days average values in an easy way.
>> 
> 
> With this new feature I'm submitting, you can adjust your database 
> startup scripts to make this happen again.  Start the server, 
> immediately loop over every database and call pg_stat_reset on them
> all, and call pg_stat_reset_shared('bgwriter').  Now you've got
> completely cleared stats that are within a second or two of 
> pg_postmaster_start_time(), should be close enough to most purposes.
>  Theoretically we could automate that better, but I've found it hard
> to justify working on given that it's not that difficult to handle
> outside of the database once the individual pieces are exposed.
> 


Great, this is good enough and we get what we need. Thanks :-)

regards
-- 
 Rafael Martinez, <r(dot)m(dot)guerrero(at)usit(dot)uio(dot)no>
 Center for Information Technology Services
 University of Oslo, Norway

 PGP Public Key: http://folk.uio.no/rafael/

In response to

pgsql-hackers by date

Next:From: Dann CorbitDate: 2010-01-14 21:13:10
Subject: Source code for pg_bulkload
Previous:From: Joshua D. DrakeDate: 2010-01-14 21:03:46
Subject: Re: plpython3

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group