Re: Log a sample of transactions

Поиск
Список
Период
Сортировка
Искать
От
Adrien Nayrat
Тема
Re: Log a sample of transactions
Дата
Msg-id
bb095cee-9fab-f814-1831-b6c06fbcf744@anayrat.info
Ответ на
Список
Дерево обсуждения
Log a sample of transactions Adrien Nayrat <adrien.nayrat@anayrat.info>
RE: Log a sample of transactions "Kuroda, Hayato" <kuroda.hayato@jp.fujitsu.com>
Re: Log a sample of transactions Adrien NAYRAT <adrien.nayrat@anayrat.info>
RE: Log a sample of transactions "Kuroda, Hayato" <kuroda.hayato@jp.fujitsu.com>
Re: Log a sample of transactions Adrien NAYRAT <adrien.nayrat@anayrat.info>
RE: Log a sample of transactions "Kuroda, Hayato" <kuroda.hayato@jp.fujitsu.com>
Re: Log a sample of transactions Adrien NAYRAT <adrien.nayrat@anayrat.info>
RE: Log a sample of transactions "Kuroda, Hayato" <kuroda.hayato@jp.fujitsu.com>
Re: Log a sample of transactions Adrien Nayrat <adrien.nayrat@anayrat.info>
Re: Log a sample of transactions Michael Paquier <michael@paquier.xyz>
Re: Log a sample of transactions Adrien NAYRAT <adrien.nayrat@anayrat.info>
Re: Log a sample of transactions Michael Paquier <michael@paquier.xyz>
Re: Log a sample of transactions Andres Freund <andres@anarazel.de>
Re: Log a sample of transactions Adrien NAYRAT <adrien.nayrat@anayrat.info>
Re: Log a sample of transactions Adrien NAYRAT <adrien.nayrat@anayrat.info>
Re: Re: Log a sample of transactions David Steele <david@pgmasters.net>
RE: Re: Log a sample of transactions "Kuroda, Hayato" <kuroda.hayato@jp.fujitsu.com>
Re: Log a sample of transactions Adrien NAYRAT <adrien.nayrat@anayrat.info>
RE: Log a sample of transactions "Kuroda, Hayato" <kuroda.hayato@jp.fujitsu.com>
Re: Log a sample of transactions Adrien NAYRAT <adrien.nayrat@anayrat.info>
Re: Log a sample of transactions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Log a sample of transactions Adrien NAYRAT <adrien.nayrat@anayrat.info>
Re: Log a sample of transactions Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: Log a sample of transactions Adrien Mobile <adrien.nayrat@anayrat.info>
Re: Log a sample of transactions Masahiko Sawada <sawada.mshk@gmail.com>
Re: Log a sample of transactions Adrien NAYRAT <adrien.nayrat@anayrat.info>
Re: Log a sample of transactions Michael Paquier <michael@paquier.xyz>
Re: Log a sample of transactions Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: Log a sample of transactions Adrien NAYRAT <adrien.nayrat@anayrat.info>
Re: Log a sample of transactions Robert Haas <robertmhaas@gmail.com>
Re: Log a sample of transactions Masahiko Sawada <sawada.mshk@gmail.com>
Re: Log a sample of transactions Adrien NAYRAT <adrien.nayrat@anayrat.info>
On 1/28/19 2:53 AM, Kuroda, Hayato wrote:
> BTW, I give you a suggestion about a test.
> This parameter enables users to log statements randomly, hence adding some tests is very difficult.
> Perhaps Only three cases are available:
> 
> * When log_transaction_sample_rate is set to 1, all statements are logged.
> * When the parameter is set to 0, they are never logged.
> * When the parameter change to 0 inside the transaction, logging is immediately stopped.

I agree we should add tests, my main problem is log output contains duration
information:

postgres=# select 1;
LOG:  duration: 0.539 ms  statement: select 1;

I did not find any test for log_min_duration that could help me. LCOV indicate
there is no tests on this part (look check_log_duration()):
https://coverage.postgresql.org/src/backend/tcop/postgres.c.gcov.html

I will look how to test this properly with test infrastructure. Maybe a simple
regex to remove duration part will be enough.

В списке pgsql-hackers по дате отправления
От: Vik Fearing
Дата:
От: Thomas Munro
Дата:
FAQ