pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: raghu ram <raghuchennuru@gmail.com>
To: Mario Splivalo <mario.splivalo@megafon.hr>
Cc: pgsql-admin@postgresql.org
Subject: Re: Reseting statistics, cluster wide
Date: Thu, 21 Apr 2011 02:19:46 +0530
Message-ID: <BANLkTin5W3T8eO6xHoxXaRFF8dJ6R_OSxg@mail.gmail.com> (raw)
In-Reply-To: <4DAF3492.1000205@megafon.hr>
References: <4DAF3492.1000205@megafon.hr>

On Thu, Apr 21, 2011 at 1:01 AM, Mario Splivalo
<mario.splivalo@megafon.hr>wrote:

> I have set up munin monitoring that plots nice graphs using
> pg_stat_bgwriter and pg_stat_database views. It has been on for quite some
> time now, and the numbers those views return are too big for munin to
> handle. I would like to reset those statistics. As explained by manual,
> pg_stat_reset() resets only db-related statistics, not the ones used
> cluster-wide. Is there a way to reset those? I don't mind stopping the
> server if I need to, but I'd realy like to have those started all over
> again.
>


Currently we don't have such feature to reset statistics on cluster level.
You have to use two PostgreSQL functions like pg_stat_reset_shared(text),
pg_stat_reset ().


There are a few statistics that are only kept on a per-cluster basis, such
as those reported in pg_stat_database and pg_stat_bgwriter. Since
pg_stat_reset only resets per-database statistics.


psql=# select pg_stat_reset();


psql=# select pg_stat_reset_shared('bgwritter');  -- It will reset the
statistics shown by pg_stat_bgwritter.


--Raghu Ram




>
>        Mario
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

view thread (8+ messages)  latest in thread

Message-ID: <BANLkTin5W3T8eO6xHoxXaRFF8dJ6R_OSxg@mail.gmail.com>
Permalink:  ../BANLkTin5W3T8eO6xHoxXaRFF8dJ6R_OSxg@mail.gmail.com/
Also on:    postgresql.org/message-id/BANLkTin5W3T8eO6xHoxXaRFF8dJ6R_OSxg@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: raghuchennuru@gmail.com, mario.splivalo@megafon.hr
  Subject: Re: Reseting statistics, cluster wide
  In-Reply-To: <BANLkTin5W3T8eO6xHoxXaRFF8dJ6R_OSxg@mail.gmail.com>
  References: <4DAF3492.1000205@megafon.hr> <BANLkTin5W3T8eO6xHoxXaRFF8dJ6R_OSxg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox