Re: idea: log_statement_sample_rate - bottom limit for sampling
Adrien Nayrat <adrien.nayrat@anayrat.info>
From: Adrien Nayrat <adrien.nayrat@anayrat.info>
To: Pavel Stehule <pavel.stehule@gmail.com>, Gilles Darold <gilles@darold.net>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2019-06-18T12:03:27Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Revert "Add log_statement_sample_rate parameter"
- 75506195da81 13.0 landed
- d5f53a8e26ca 12.0 landed
-
Revert "Silence compiler warning"
- 4f9ed8f3c5ef 13.0 landed
- d8453ccfbfd6 12.0 landed
Attachments
- log_statement_sample_limit-3.patch (text/x-patch) patch
Hi,
I tried the patch, here my comment:
> gettext_noop("Zero effective disables sampling. "
> "-1 use sampling every time (without limit)."),
I do not agree with the zero case. In fact, sampling is disabled as soon as
setting is less than log_min_duration_statements. Furthermore, I think we should
provide a more straightforward description for users.
I changed few comments and documentation:
* As we added much more logic in this function with statement and transaction
sampling. And now with statement_sample_rate, it is not easy to understand the
logic on first look. I reword comment in check_log_duration, I hope it is more
straightforward.
* I am not sure if "every_time" is a good naming for the variable. In fact, if
duration exceeds limit we disable sampling. Maybe sampling_disabled is more clear?
* I propose to add some words in log_min_duration_statement and
log_statement_sample_rate documentation.
* Rephrased log_statement_sample_limit documentation, I hope it help
understanding.
Patch attached.
Regards,
--
Adrien