Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 6B2881337B47 for ; Wed, 20 Apr 2011 17:49:57 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 96346-07 for ; Wed, 20 Apr 2011 20:49:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ey0-f174.google.com (mail-ey0-f174.google.com [209.85.215.174]) by mail.postgresql.org (Postfix) with ESMTP id D9CB6133616B for ; Wed, 20 Apr 2011 17:49:47 -0300 (ADT) Received: by eyx24 with SMTP id 24so333319eyx.19 for ; Wed, 20 Apr 2011 13:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=YKeWx2x/Ed9yxEfuxeabqvWjC/4fvWAjj3yu4yz3bys=; b=fxf+H11XuINmNID3iMBRpSaZaDXyzmsN/2f+fSNy9HlkozUf6Q3expK88NUX+QIQ3w HjKumKWV49jZGMWT4J+Z4JDvi9jKjPl1r3NfkKLb6ASNce0CSSRF88lg5+dAFYcO/5Vq GikaHURYLZli02V4yxW/gxbnsI1fwaGZ6Dmww= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=PIyRSoKklujvyPpeIHHehMII09ZFMszEvKHh/O37FSNKj4/QaBM+ar+BYxnhLZKQuC IzSl1QI/ddr7zOKWrTifcQ4wWm8AWzL4G1AIwkqahTAEdS8T5ZFJ1y3qg11/lpWYjIaL jbTn/4EFzUGbEwdEo/xfpPbM420jbhiP+y6IU= MIME-Version: 1.0 Received: by 10.213.98.201 with SMTP id r9mr3126333ebn.42.1303332586830; Wed, 20 Apr 2011 13:49:46 -0700 (PDT) Received: by 10.213.98.65 with HTTP; Wed, 20 Apr 2011 13:49:46 -0700 (PDT) In-Reply-To: <4DAF3492.1000205@megafon.hr> References: <4DAF3492.1000205@megafon.hr> Date: Thu, 21 Apr 2011 02:19:46 +0530 Message-ID: Subject: Re: Reseting statistics, cluster wide From: raghu ram To: Mario Splivalo Cc: pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=00504502d2e2dcbd3504a15fc3a3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.897 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201104/195 X-Sequence-Number: 37376 --00504502d2e2dcbd3504a15fc3a3 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Apr 21, 2011 at 1:01 AM, Mario Splivalo 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 > --00504502d2e2dcbd3504a15fc3a3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Thu, Apr 21, 2011 at 1:01 AM, Mario S= plivalo <= mario.splivalo@megafon.hr> wrote:
I have set up munin monitoring that plots nice graphs using pg_stat_bgwrite= r and pg_stat_database views. It has been on for quite some time now, and t= he 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= 9;d realy like to have those started all over again.


Currently we don't have such featu= re to reset statistics on cluster level. You have to use two PostgreSQL fun= ctions 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 tho= se reported in pg_stat_database and pg_stat_bgwriter. Since pg_stat_reset o= nly resets per-database statistics.


psql= =3D# select pg_stat_reset();


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


-= -Raghu Ram


=A0

=A0 =A0 =A0 =A0Mario

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

--00504502d2e2dcbd3504a15fc3a3--