From 5fc086896ac9b92f69a9ac05dd4bef3ef6ec489b Mon Sep 17 00:00:00 2001 From: Anastasia Alexandrova Date: Tue, 28 Jun 2022 22:37:56 +0300 Subject: [PATCH 1/2] PG-460 Updated pgsm_normalized_query description (#274) modified: docs/USER_GUIDE.md --- docs/USER_GUIDE.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md index 7c30513..c4d1010 100644 --- a/docs/USER_GUIDE.md +++ b/docs/USER_GUIDE.md @@ -221,9 +221,11 @@ This parameter controls whether utility commands are tracked by the module. Util ##### pg_stat_monitor.pgsm_normalized_query -Type: boolean. Default: 1 +Type: boolean. Default: 0 -By default, the query shows the actual parameter instead of the placeholder. It is quite useful when users want to use that query and try to run that query to check the abnormalities. But in most cases users like the queries with a placeholder. This parameter is used to toggle between the two said options. +By default, the query shows the actual parameter instead of the placeholder. It is quite useful when users want to use that query and try to run that query to check the abnormalities. Users should be aware, however, that running queries with disabled normalization can expose some sensitive data. + +But in most cases users like the queries with a placeholder. This parameter is used to toggle between the two said options. ##### pg_stat_monitor.pgsm_max_buckets From fb119cab89941cd1dbe7775d0026c6951d73a52c Mon Sep 17 00:00:00 2001 From: Anastasia Alexandrova Date: Tue, 28 Jun 2022 22:37:06 +0300 Subject: [PATCH 2/2] PG-459 Documented changes in setting pgsm sta (#272) rt time modified: docs/USER_GUIDE.md --- docs/USER_GUIDE.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md index c4d1010..de4d5e8 100644 --- a/docs/USER_GUIDE.md +++ b/docs/USER_GUIDE.md @@ -9,7 +9,7 @@ ## Introduction -This document describes the features, functions and configuration of the ``pg_stat_monitor`` extension and gives some usage examples. For how to install and set up ``pg_stat_monitor``, see [Installation in README](https://github.com/percona/pg_stat_monitor/blob/master/README.md#installation). +This document describes the features, functions and configuration of the ``pg_stat_monitor`` extension and gives some usage examples. For how to install and set up ``pg_stat_monitor``, see [Setting up](setup.md). ## Features @@ -35,6 +35,11 @@ The following are the key features of pg_stat_monitor: Instead of supplying one set of ever-increasing counts, `pg_stat_monitor` computes stats for a configured number of time intervals; time buckets. This allows for much better data accuracy, especially in the case of high-resolution or unreliable networks. +Starting with release 1.1.0, buckets have fixed and consistent time windows. This enables external applications such as PMM to easily consume and chart the statistics data. To make this happen, the bucket start time is rounded down to the nearest bucket time size. + +Note, however, that if you disable / enable the `pg_stat_monitor` at runtime, the first bucket may not contain all the data. For example, if `pg_stat_monitor` is enabled at 03:58:30, a 60-second bucket start time is set to 03:58:00 and this bucket may not contain the data for queries made between 03:58:00 and 03:58:30. To learn more about the bucket start time and size, see [pg_stat_monitor.pgsm_bucket_time](#pg_stat_monitorpgsm_bucket_time). + + ### Table and index access statistics per statement `pg_stat_monitor` collects the information about what tables were accessed by a statement. This allows you to identify all queries which access a given table easily. @@ -245,9 +250,15 @@ Values: - Max: 2147483647 - Default: 60 -This parameter is used to set the lifetime of the bucket. System switches between buckets on the basis of [pg_stat_monitor.pgsm_bucket_time](#pg-stat-monitorpgsm-bucket-time). +This parameter sets the lifetime of the bucket. The system switches between buckets on the basis of [pg_stat_monitor.pgsm_bucket_time](#pg-stat-monitorpgsm-bucket-time). -Requires the server restart. +Starting with release 1.1.0, the behavior of setting the bucket start time has changed. Previously, the bucket start time was aligned with the time of the first query arrived to that bucket. Now the bucket start time is rounded down to the bucket time size. To illustrate, if the first query arrives to a 60 second bucket at 03:01:15, the bucket start time is set to 03:01:00. + +With this new behavior, buckets have now consistent time windows so that external applications such as PMM can easily consume the data in buckets. + +Note that if you disable / enable the `pg_stat_monitor` at runtime, the first bucket may not contain all the data. Thus, if `pg_stat_monitor` is enabled at 03:58:30, the bucket start time is set to 03:58:00 but it will not contain the data for queries made between 03:58:00 and 03:58:30. + +The parameter requires the server restart. ##### pg_stat_monitor.pgsm_histogram_min