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 1lBTgX-0005ym-Hn for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Feb 2021 02:32:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lBTgV-0000VA-Ly for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Feb 2021 02:32:23 +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 1lBTgV-0000V2-Eu for pgsql-hackers@lists.postgresql.org; Mon, 15 Feb 2021 02:32:23 +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 1lBTgO-0000mU-OJ for pgsql-hackers@postgresql.org; Mon, 15 Feb 2021 02:32:22 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTP id DE4296280A; Mon, 15 Feb 2021 11:32:12 +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, 15 Feb 2021 11:32:12 +0900 From: Masahiro Ikeda To: Fujii Masao Cc: PostgreSQL-development , Masahiko Sawada , Li Japin , kuroda.hayato@fujitsu.com, "David G. Johnston" 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> <95c26651303d0e5227cb763061cf15dc@oss.nttdata.com> <395f109540835fabe76dbd9d45733a14@oss.nttdata.com> <925e940a832e96ca5d7276a4cc3dec83@oss.nttdata.com> <3df6e23e3e1e9cd95b08c943ef320046@oss.nttdata.com> Message-ID: <57870df084d7f0462a29b9a9c8d49d44@oss.nttdata.com> 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-02-08 13:01, Fujii Masao wrote: > On 2021/02/05 8:45, Masahiro Ikeda wrote: >> I pgindented the patches. > > Thanks for updating the patches! Thanks for checking the patches. > + XLogWrite, which nomally called by an > + issue_xlog_fsync, which nomally called by > an > > Typo: "nomally" should be "normally"? Yes, I'll fix it. > + XLogFlush request(see linkend="wal-configuration"/>) > + XLogFlush request(see linkend="wal-configuration"/>), > > Isn't it better to add a space character just after "request"? Thanks, I'll fix it. > + INSTR_TIME_SET_CURRENT(duration); > + INSTR_TIME_SUBTRACT(duration, start); > + WalStats.m_wal_write_time = INSTR_TIME_GET_MICROSEC(duration); > > If several cycles happen in the do-while loop, m_wal_write_time should > be > updated with the sum of "duration" in those cycles instead of > "duration" > in the last cycle? If yes, "+=" should be used instead of "=" when > updating > m_wal_write_time? > + INSTR_TIME_SET_CURRENT(duration); > + INSTR_TIME_SUBTRACT(duration, start); > + WalStats.m_wal_sync_time = INSTR_TIME_GET_MICROSEC(duration); > > Also "=" should be "+=" in the above? Yes, they are my mistake when changing the unit from milliseconds to microseconds. Regards, -- Masahiro Ikeda NTT DATA CORPORATION