Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3swE-0004u1-U6 for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Jan 2021 03:53:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l3swD-0002ZM-2y for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Jan 2021 03:53:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3swC-0002ZF-SN for pgsql-hackers@lists.postgresql.org; Mon, 25 Jan 2021 03:53:12 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3swA-0006ag-9f for pgsql-hackers@postgresql.org; Mon, 25 Jan 2021 03:53:11 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTP id 02E5D62750; Mon, 25 Jan 2021 12:53:05 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 25 Jan 2021 12:53:05 +0900 From: Masahiro Ikeda To: kuroda.hayato@fujitsu.com Cc: japin , Masahiko Sawada , PostgreSQL-development Subject: RE: About to add WAL write/fsync statistics to pg_stat_wal view In-Reply-To: References: <0509ad67b585a5b86a83d445dfa75392@oss.nttdata.com> <65e99b78066ab1e3dc82a4e6f5e6f3cd@oss.nttdata.com> <7aef8ee6eea05a38ca91580caa5b2f07@oss.nttdata.com> <8555ab589d74ec2df61237209f4f21f2@oss.nttdata.com> <459df7fb095af8d2398ed633c1e9999a@oss.nttdata.com> Message-ID: X-Sender: ikedamsh@oss.nttdata.com User-Agent: Roundcube Webmail/1.1.9 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2021-01-25 10:34, kuroda.hayato@fujitsu.com wrote: > Dear Ikeda-san, > > Thank you for updating the patch. This can be applied to master, and > can be used on my RHEL7. > wal_write_time and wal_sync_time increase normally :-). > > ``` > postgres=# select * from pg_stat_wal; > -[ RECORD 1 ]----+------------------------------ > wal_records | 121781 > wal_fpi | 2287 > wal_bytes | 36055146 > wal_buffers_full | 799 > wal_write | 12770 > wal_write_time | 4.469 > wal_sync | 11962 > wal_sync_time | 132.352 > stats_reset | 2021-01-25 00:51:40.674412+00 > ``` Thanks for checking. > I put a further comment: > > ``` > @@ -3485,7 +3485,53 @@ SELECT pid, wait_event_type, wait_event FROM > pg_stat_activity WHERE wait_event i > wal_buffers_full bigint > > > - Number of times WAL data was written to disk because WAL > buffers became full > + Total number of times WAL data was written to disk because WAL > buffers became full > + > + > + > + > + role="column_definition"> > + wal_write bigint > + > + > + Total number of times WAL data was written to disk > + > + > + > + > + role="column_definition"> > + wal_write_time double > precision > + > + > + Total amount of time that has been spent in the portion of > + WAL data was written to disk, in milliseconds > + (if is enabled, > otherwise zero). > + > + > + > + > + role="column_definition"> > + wal_sync bigint > + > + > + Total number of times WAL data was synced to disk > + (if is > open_datasync or > + open_sync, this value is zero because WAL > data is synced > + when to write it). > + > + > + > + > + role="column_definition"> > + wal_sync_time double > precision > + > + > + Total amount of time that has been spent in the portion of > + WAL data was synced to disk, in milliseconds > + (if is enabled, > otherwise zero. > + if is > open_datasync or > + open_sync, this value is zero too because > WAL data is synced > + when to write it). > > > ``` > > Maybe "Total amount of time" should be used, not "Total number of > time." > Other views use "amount." Thanks. I checked columns' descriptions of other views. There are "Number of xxx", "Total number of xxx", "Total amount of time that xxx" and "Total time spent xxx". Since the "time" is used for showing spending time, not count, I'll change it to "Total number of WAL data written/synced to disk". Thought? Regards, -- Masahiro Ikeda NTT DATA CORPORATION