From 0b9479aa19ca608215dcd8fc937fae5e03b7a0e7 Mon Sep 17 00:00:00 2001 From: Anastasia Alexadrova Date: Wed, 30 Mar 2022 18:41:39 +0300 Subject: [PATCH 01/28] PG-358 Documented block and WAL data display Due to different data processing by both extensions, these stats appear as inconsistent. modified: README.md modified: docs/COMPARISON.md --- README.md | 4 +++- docs/COMPARISON.md | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c93e8f..f33e5a5 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,9 @@ The `pg_stat_monitor` is a **_Query Performance Monitoring_** tool for PostgreSQ `pg_stat_monitor` provides improved insights that allow database users to understand query origins, execution, planning statistics and details, query information, and metadata. This significantly improves observability, enabling users to debug and tune query performance. `pg_stat_monitor` is developed on the basis of `pg_stat_statements` as its more advanced replacement. -While `pg_stat_statements` provides ever-increasing metrics, `pg_stat_monitor` aggregates the collected data, saving user efforts for doing it themselves. `pg_stat_monitor` stores statistics in configurable time-based units – buckets. This allows focusing on statistics generated for shorter time periods and makes query timing information such as max/min/mean time more accurate. +While `pg_stat_statements` provides ever-increasing metrics, `pg_stat_monitor` aggregates the collected data, saving user efforts for doing it themselves. `pg_stat_monitor` stores statistics in configurable time-based units – buckets. This allows focusing on statistics generated for shorter time periods and makes query timing information such as max/min/mean time more accurate. + +>**NOTE**: Because of these differences in data processing, memory blocks and WAL (Write Ahead Logs) related statistics data are displayed inconsistently when both `pg_stat_monitor` and `pg_stat_statements` are used together. To learn about other features, available in `pg_stat_monitor`, see the [Features](#pg_stat_monitor-features) section and the [User Guide](https://github.com/percona/pg_stat_monitor/blob/master/docs/USER_GUIDE.md). diff --git a/docs/COMPARISON.md b/docs/COMPARISON.md index 92aa8a4..fe6d786 100644 --- a/docs/COMPARISON.md +++ b/docs/COMPARISON.md @@ -4,6 +4,9 @@ The `pg_stat_monitor` extension is developed on the basis of `pg_stat_statements Thus, `pg_stat_monitor` inherits the columns available in `pg_stat_statements` plus provides additional ones. +Note that [`pg_stat_monitor` and `pg_stat_statements` process statistics data differently](index.md#how-pg_stat_monitor-works). Because of these differences, memory blocks and WAL (Write Ahead Logs) related statistics data are displayed inconsistently when both extensions are used together. + + To see all available columns, run the following command from the `psql` terminal: ```sql From b99e1018afae23ae1d7000d95511857aaa48ede9 Mon Sep 17 00:00:00 2001 From: Ibrar Ahmed Date: Wed, 20 Apr 2022 07:44:11 +0000 Subject: [PATCH 02/28] PG-380: Bump version to 1.0.0. --- pg_stat_monitor.c | 2 +- regression/expected/version.out | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pg_stat_monitor.c b/pg_stat_monitor.c index f3db2ad..956bd32 100644 --- a/pg_stat_monitor.c +++ b/pg_stat_monitor.c @@ -27,7 +27,7 @@ PG_MODULE_MAGIC; -#define BUILD_VERSION "1.0.0-rc.2" +#define BUILD_VERSION "1.0.0" #define PG_STAT_STATEMENTS_COLS 53 /* maximum of above */ #define PGSM_TEXT_FILE "/tmp/pg_stat_monitor_query" diff --git a/regression/expected/version.out b/regression/expected/version.out index 2a6b2f1..ab1dd21 100644 --- a/regression/expected/version.out +++ b/regression/expected/version.out @@ -2,7 +2,7 @@ CREATE EXTENSION pg_stat_monitor; SELECT pg_stat_monitor_version(); pg_stat_monitor_version ------------------------- - 1.0.0-rc.2 + 1.0.0 (1 row) DROP EXTENSION pg_stat_monitor; From f09643f592fcf1b0b7e74f0944018a0bf13d45b8 Mon Sep 17 00:00:00 2001 From: Evgeniy Patlan Date: Fri, 29 Apr 2022 13:33:07 +0300 Subject: [PATCH 03/28] PG-7 add ubuntu22 support --- debian/rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/rules b/debian/rules index f4f90c0..4293a1c 100755 --- a/debian/rules +++ b/debian/rules @@ -11,6 +11,9 @@ export USE_PGXS=1 %: dh $@ +override_dh_builddeb: + dh_builddeb -- -Zgzip + override_dh_auto_build: +pg_buildext clean . build-%v +pg_buildext build . build-%v From 94c231ae61f948e8b903fa4ab2441d7490d1aa5d Mon Sep 17 00:00:00 2001 From: Anastasia Alexadrova Date: Thu, 28 Apr 2022 14:34:06 +0300 Subject: [PATCH 04/28] PG-387 Release note for GA release modified: docs/RELEASE_NOTES.md --- docs/RELEASE_NOTES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 5a630c4..db2c401 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -2,6 +2,10 @@ Below is the complete list of release notes for every version of ``pg_stat_monitor``. +## 1.0.0 + +Bump version from 1.0.0-rc.2 to 1.0.0. + ## 1.0.0-rc.2 ### Improvements @@ -132,6 +136,7 @@ Column datname (string) was added (replacement for dbid). ## REL0_7_0_STABLE + ### Improvements [PG-153](https://jira.percona.com/browse/PG-153): Capture and record the application_name executing the query. From 5237f8afe2968502c0fc26a455e3906b9ce1d401 Mon Sep 17 00:00:00 2001 From: Kai Wagner Date: Mon, 2 May 2022 13:41:41 +0200 Subject: [PATCH 05/28] PG-366 remove beta release warning from README.md Signed-off-by: Kai Wagner --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index e860ea1..b46d5b0 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,6 @@ ## Overview -**NOTE**: This is a beta release and is subject to further changes. We recommend using it in testing environments only. - The `pg_stat_monitor` is a **_Query Performance Monitoring_** tool for PostgreSQL. It attempts to provide a more holistic picture by providing much-needed query performance insights in a [single view](https://github.com/percona/pg_stat_monitor/blob/master/docs/REFERENCE.md). `pg_stat_monitor` provides improved insights that allow database users to understand query origins, execution, planning statistics and details, query information, and metadata. This significantly improves observability, enabling users to debug and tune query performance. `pg_stat_monitor` is developed on the basis of `pg_stat_statements` as its more advanced replacement. From 56833b428fed5c5b750d9f3aca57da38a1e9dd66 Mon Sep 17 00:00:00 2001 From: Kai Wagner Date: Tue, 3 May 2022 11:56:28 +0200 Subject: [PATCH 06/28] PG-365: bump version in META.json file to the latest release Signed-off-by: Kai Wagner --- META.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/META.json b/META.json index 0397750..bcc3fdb 100644 --- a/META.json +++ b/META.json @@ -2,7 +2,7 @@ "name": "pg_stat_monitor", "abstract": "PostgreSQL Query Performance Monitoring Tool", "description": "pg_stat_monitor is a PostgreSQL Query Performance Monitoring tool, based on PostgreSQL's contrib module pg_stat_statements. PostgreSQL’s pg_stat_statements provides the basic statistics, which is sometimes not enough. The major shortcoming in pg_stat_statements is that it accumulates all the queries and their statistics and does not provide aggregated statistics nor histogram information. In this case, a user would need to calculate the aggregates, which is quite an expensive operation.", - "version": "0.9.2-beta1", + "version": "1.0.0", "maintainer": [ "ibrar.ahmed@percona.com" ], @@ -12,7 +12,7 @@ "abstract": "PostgreSQL Query Performance Monitoring Tool", "file": "pg_stat_monitor--1.0.sql", "docfile": "README.md", - "version": "0.9.2-beta1" + "version": "1.0.0" } }, "prereqs": { @@ -23,6 +23,7 @@ } }, "resources": { + "homepage": "https://percona.github.io/pg_stat_monitor/", "bugtracker": { "web": "https://jira.percona.com/projects/PG/issues" }, From d1282620ea2b39803ff7b2b564a65ed8e2cf729a Mon Sep 17 00:00:00 2001 From: Anastasia Alexadrova Date: Tue, 3 May 2022 16:38:05 +0200 Subject: [PATCH 07/28] PG-407 Added a 404 page to docs new file: docs/overrides/404.html modified: mkdocs.yml --- docs/overrides/404.html | 9 +++++++++ mkdocs.yml | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 docs/overrides/404.html diff --git a/docs/overrides/404.html b/docs/overrides/404.html new file mode 100644 index 0000000..3d37173 --- /dev/null +++ b/docs/overrides/404.html @@ -0,0 +1,9 @@ +{#- + This file was automatically generated - do not edit +-#} +{% extends "main.html" %} +{% block content %} +

404 - Not found

+

+We can't find the page you are looking for. Try using the Search or return to homepage .

+{% endblock %} diff --git a/mkdocs.yml b/mkdocs.yml index 48a8292..97abcc7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,6 +16,8 @@ theme: name: material logo: _images/percona-logo.svg favicon: _images/percona-favicon.ico + custom_dir: docs/overrides + palette: # Light mode From 6224442f127b4e4958a281fde669461f08c1bdfb Mon Sep 17 00:00:00 2001 From: Naeem Akhter Date: Wed, 4 May 2022 18:45:40 +0500 Subject: [PATCH 08/28] PG-384: Fix coverall.io badge on REL1_0_STABLE branch in PGSM repo. This will make sure that coverall.io stats are reflected as REL1_0_STABLE branch. --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index b46d5b0..2219b3a 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ -[![Coverage Status](https://coveralls.io/repos/github/percona/pg_stat_monitor/badge.svg)](https://coveralls.io/github/percona/pg_stat_monitor) - +[![Coverage Status](https://coveralls.io/repos/github/percona/pg_stat_monitor/badge.svg?branch=REL1_0_STABLE)](https://coveralls.io/github/percona/pg_stat_monitor?branch=REL1_0_STABLE) # pg_stat_monitor: Query Performance Monitoring Tool for PostgreSQL ## Table of Contents From a43dc879f9713b0b5659d5dfd3d0f4b748cd22e3 Mon Sep 17 00:00:00 2001 From: Anastasia Alexandrova Date: Tue, 10 May 2022 20:06:26 +0200 Subject: [PATCH 09/28] PG-411 Updated the list of primary keys (#222) modified: docs/USER_GUIDE.md --- docs/USER_GUIDE.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md index a285714..7c30513 100644 --- a/docs/USER_GUIDE.md +++ b/docs/USER_GUIDE.md @@ -114,19 +114,24 @@ Learn more about using histograms from the [usage example](#histogram-1). ### `pg_stat_monitor` view -The statistics gathered by the module are made available via the view named `pg_stat_monitor`. This view contains one row for each distinct combination of metrics and whether it is a top-level statement or not (up to the maximum number of distinct statements that the module can track). For details about available counters, refer to the [`pg_stat_monitor` view reference](https://github.com/percona/pg_stat_monitor/blob/master/docs/REFERENCE.md). +The statistics gathered by the module are made available via the view named `pg_stat_monitor`. This view contains one row for each distinct combination of metrics and whether it is a top-level statement or not (up to the maximum number of distinct statements that the module can track). For details about available counters, refer to the [`pg_stat_monitor` view reference](REFERENCE.md). The following are the primary keys for pg_stat_monitor: -* `bucket`, -* `userid`, -* `dbid`, -* `client_ip`, -* `application_name`. +* `bucket` +* `userid` +* `datname` +* `queryid` +* `client_ip` +* `planid` +* `application_name` +* `toplevel`. -A new row is created for each key in the `pg_stat_monitor` view. +> **NOTE**: The `toplevel` key is considered starting with PostgreSQL 14 and above. For PostgreSQL 13 and earlier versions, the `toplevel` value is set to 1 by default, and thus, ignored. -`pg_stat_monitor` inherits the metrics available in `pg_stat_statements`, plus provides additional ones. See the [`pg_stat_monitor` vs `pg_stat_statements` comparison](https://github.com/percona/pg_stat_monitor/blob/master/docs/REFERENCE.md) for details. +A new row is created for each key in the `pg_stat_monitor` view. + +`pg_stat_monitor` inherits the metrics available in `pg_stat_statements`, plus provides additional ones. See the [`pg_stat_monitor` vs `pg_stat_statements` comparison](COMPARISON.md) for details. For security reasons, only superusers and members of the `pg_read_all_stats` role are allowed to see the SQL text and `queryid` of queries executed by other users. Other users can see the statistics, however, if the view has been installed in their database. From 5abd8bb3a71f115e0cbecc6d09b7ec96b1dfaaeb Mon Sep 17 00:00:00 2001 From: Kai Wagner Date: Mon, 16 May 2022 15:00:01 +0200 Subject: [PATCH 10/28] DISTPG-427: replaced return with goto exit to not break other extensions Signed-off-by: Kai Wagner --- pg_stat_monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pg_stat_monitor.c b/pg_stat_monitor.c index 956bd32..9c26380 100644 --- a/pg_stat_monitor.c +++ b/pg_stat_monitor.c @@ -3507,11 +3507,11 @@ pgsm_emit_log_hook(ErrorData *edata) goto exit; if (IsParallelWorker()) - return; + goto exit; /* Check if PostgreSQL has finished its own bootstraping code. */ if (MyProc == NULL) - return; + goto exit; if ((edata->elevel == ERROR || edata->elevel == WARNING || edata->elevel == INFO || edata->elevel == DEBUG1)) { From 8f87bf8e7a15d6730c02a5fed41a1b3a47178326 Mon Sep 17 00:00:00 2001 From: Kai Wagner Date: Tue, 17 May 2022 13:10:42 +0200 Subject: [PATCH 11/28] PG-412: added 'Get engaged' to the welcome page Signed-off-by: Kai Wagner --- docs/index.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/index.md b/docs/index.md index a76d36c..671e77a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -40,6 +40,12 @@ The RPM packages are also available in the official PostgreSQL (PGDG) `yum` repo * Use the [installation guidelines](setup.md) to install and set up `pg_stat_monitor`. * Refer to the [User guide](USER_GUIDE.md) for details about available features and functions, usage examples and configuration parameters. +## Get engaged + +* Use the [contributing guide](https://github.com/percona/pg_stat_monitor/blob/REL1_0_STABLE/CONTRIBUTING.md) to learn how to become a contributor. +* Use the [forum](https://forums.percona.com/c/postgresql/pg-stat-monitor/69) to discuss a topic with the community. + + ## Read more * [`pg_stat_monitor` view reference](REREFENCE.md) From 1b995c768db73fc8faa5f1e5c6f6b5784849f7b7 Mon Sep 17 00:00:00 2001 From: Ibrar Ahmed <“ibrar.ahmed@percona.com”> Date: Sun, 22 May 2022 03:49:03 +0000 Subject: [PATCH 12/28] PG-417: Replace 'CREATE OR REPLACE' with 'CREATE' for extension. While analyzing the pg_stat_monitor installation scripts I found several vulnerabilities. pg_stat_monitor uses CREATE OR REPLACE to install its functions which is a security hazard. An attacker can precreate the functions have a superuser install the extension and after installation the attacker can switch out the function with a malicious version since he would still be the owner of the function. Instead of CREATE OR REPLACE the installation script should use plain CREATE to prevent this attack. For reference https://www.postgresql.org/docs/current/extend-extensions.html#EXTEND-EXTENSIONS-SECURITY https://github.com/timescale/pgspot --- pg_stat_monitor--1.0.13.sql.in | 6 +++--- pg_stat_monitor--1.0.14.sql.in | 6 +++--- pg_stat_monitor--1.0.sql.in | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pg_stat_monitor--1.0.13.sql.in b/pg_stat_monitor--1.0.13.sql.in index 5de6083..1ba41dd 100644 --- a/pg_stat_monitor--1.0.13.sql.in +++ b/pg_stat_monitor--1.0.13.sql.in @@ -89,7 +89,7 @@ RETURNS SETOF record AS 'MODULE_PATHNAME', 'pg_stat_monitor' LANGUAGE C STRICT VOLATILE PARALLEL SAFE; -CREATE OR REPLACE FUNCTION get_state(state_code int8) RETURNS TEXT AS +CREATE FUNCTION get_state(state_code int8) RETURNS TEXT AS $$ SELECT CASE @@ -102,7 +102,7 @@ SELECT $$ LANGUAGE SQL PARALLEL SAFE; -CREATE or REPLACE FUNCTION get_cmd_type (cmd_type INTEGER) RETURNS TEXT AS +CREATE FUNCTION get_cmd_type (cmd_type INTEGER) RETURNS TEXT AS $$ SELECT CASE @@ -225,7 +225,7 @@ SELECT $$ LANGUAGE SQL PARALLEL SAFE; -CREATE OR REPLACE FUNCTION histogram(_bucket int, _quryid text) +CREATE FUNCTION histogram(_bucket int, _quryid text) RETURNS SETOF RECORD AS $$ DECLARE rec record; diff --git a/pg_stat_monitor--1.0.14.sql.in b/pg_stat_monitor--1.0.14.sql.in index 0bbb0ce..d326826 100644 --- a/pg_stat_monitor--1.0.14.sql.in +++ b/pg_stat_monitor--1.0.14.sql.in @@ -89,7 +89,7 @@ RETURNS SETOF record AS 'MODULE_PATHNAME', 'pg_stat_monitor' LANGUAGE C STRICT VOLATILE PARALLEL SAFE; -CREATE OR REPLACE FUNCTION get_state(state_code int8) RETURNS TEXT AS +CREATE FUNCTION get_state(state_code int8) RETURNS TEXT AS $$ SELECT CASE @@ -102,7 +102,7 @@ SELECT $$ LANGUAGE SQL PARALLEL SAFE; -CREATE or REPLACE FUNCTION get_cmd_type (cmd_type INTEGER) RETURNS TEXT AS +CREATE FUNCTION get_cmd_type (cmd_type INTEGER) RETURNS TEXT AS $$ SELECT CASE @@ -226,7 +226,7 @@ SELECT $$ LANGUAGE SQL PARALLEL SAFE; -CREATE OR REPLACE FUNCTION histogram(_bucket int, _quryid text) +CREATE FUNCTION histogram(_bucket int, _quryid text) RETURNS SETOF RECORD AS $$ DECLARE rec record; diff --git a/pg_stat_monitor--1.0.sql.in b/pg_stat_monitor--1.0.sql.in index fda49f7..909100a 100644 --- a/pg_stat_monitor--1.0.sql.in +++ b/pg_stat_monitor--1.0.sql.in @@ -86,7 +86,7 @@ RETURNS SETOF record AS 'MODULE_PATHNAME', 'pg_stat_monitor' LANGUAGE C STRICT VOLATILE PARALLEL SAFE; -CREATE OR REPLACE FUNCTION get_state(state_code int8) RETURNS TEXT AS +CREATE FUNCTION get_state(state_code int8) RETURNS TEXT AS $$ SELECT CASE @@ -99,7 +99,7 @@ SELECT $$ LANGUAGE SQL PARALLEL SAFE; -CREATE or REPLACE FUNCTION get_cmd_type (cmd_type INTEGER) RETURNS TEXT AS +CREATE FUNCTION get_cmd_type (cmd_type INTEGER) RETURNS TEXT AS $$ SELECT CASE @@ -212,7 +212,7 @@ SELECT $$ LANGUAGE SQL PARALLEL SAFE; -CREATE OR REPLACE FUNCTION histogram(_bucket int, _quryid text) +CREATE FUNCTION histogram(_bucket int, _quryid text) RETURNS SETOF RECORD AS $$ DECLARE rec record; From f60d3422df660163390ce4cb4ccc2f014ef59058 Mon Sep 17 00:00:00 2001 From: Ibrar Ahmed <“ibrar.ahmed@percona.com”> Date: Tue, 24 May 2022 05:13:06 +0000 Subject: [PATCH 13/28] PG-382: Adjust the maximum value for histogram buckets. There was no maximum limit set for the number of maximum histograms bucket, which can lead to a crash in case of higher value. PG-382: Adjust the maximum value for histogram buckets. Fix the regression issue for PostgreSQL-12. PG-382: Adjust the maximum value for histogram buckets. Fix the TAP test cases. --- guc.c | 2 +- pg_stat_monitor.c | 2 +- pg_stat_monitor.h | 2 +- regression/expected/guc.out | 2 +- regression/expected/guc_1.out | 2 +- t/expected/001_settings_default.out | 4 +-- .../002_settings_pgsm_track_planning.out | 30 +++++++++---------- .../003_settings_pgms_extract_comments.out | 4 +-- t/expected/004_settings_pgsm_track.out | 6 ++-- .../005_settings_pgsm_enable_query_plan.out | 4 +-- .../006_settings_pgsm_overflow_target.out | 4 +-- .../007_settings_pgsm_query_shared_buffer.out | 6 ++-- .../008_settings_pgsm_histogram_buckets.out | 10 +++---- .../009_settings_pgsm_histogram_max.out | 8 ++--- .../010_settings_pgsm_histogram_min.out | 8 ++--- t/expected/011_settings_pgsm_bucket_time.out | 12 ++++---- t/expected/012_settings_pgsm_max_buckets.out | 12 ++++---- .../013_settings_pgsm_normalized_query.out | 4 +-- .../014_settings_pgsm_track_utility.out | 4 +-- .../015_settings_pgsm_query_max_len.out | 10 +++---- t/expected/016_settings_pgsm_max.out | 10 +++---- t/expected/017_execution_stats.out | 24 ++++++++++----- 22 files changed, 89 insertions(+), 81 deletions(-) diff --git a/guc.c b/guc.c index 219f7b5..50065db 100644 --- a/guc.c +++ b/guc.c @@ -137,7 +137,7 @@ init_guc(void) .guc_desc = "Sets the maximum number of histogram buckets", .guc_default = 10, .guc_min = 2, - .guc_max = INT_MAX, + .guc_max = MAX_RESPONSE_BUCKET, .guc_restart = true, .guc_unit = 0, .guc_value = &PGSM_HISTOGRAM_BUCKETS diff --git a/pg_stat_monitor.c b/pg_stat_monitor.c index 956bd32..8cf7bd9 100644 --- a/pg_stat_monitor.c +++ b/pg_stat_monitor.c @@ -2032,7 +2032,7 @@ pg_stat_monitor_internal(FunctionCallInfo fcinfo, values[i++] = Float8GetDatumFast(tmp.blocks.blk_write_time); /* resp_calls at column number 41 */ - values[i++] = IntArrayGetTextDatum(tmp.resp_calls, MAX_RESPONSE_BUCKET); + values[i++] = IntArrayGetTextDatum(tmp.resp_calls, PGSM_HISTOGRAM_BUCKETS); /* utime at column number 42 */ values[i++] = Float8GetDatumFast(roundf(tmp.sysinfo.utime,4)); diff --git a/pg_stat_monitor.h b/pg_stat_monitor.h index eeb9210..f729cbd 100644 --- a/pg_stat_monitor.h +++ b/pg_stat_monitor.h @@ -68,7 +68,7 @@ #define JUMBLE_SIZE 1024 /* query serialization buffer size */ -#define MAX_RESPONSE_BUCKET 10 +#define MAX_RESPONSE_BUCKET 50 #define INVALID_BUCKET_ID -1 #define MAX_REL_LEN 255 #define MAX_BUCKETS 10 diff --git a/regression/expected/guc.out b/regression/expected/guc.out index 71a62ee..7a71d9f 100644 --- a/regression/expected/guc.out +++ b/regression/expected/guc.out @@ -17,7 +17,7 @@ SELECT * FROM pg_stat_monitor_settings ORDER BY name COLLATE "C"; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes diff --git a/regression/expected/guc_1.out b/regression/expected/guc_1.out index 79fd30d..d2c23fa 100644 --- a/regression/expected/guc_1.out +++ b/regression/expected/guc_1.out @@ -17,7 +17,7 @@ SELECT * FROM pg_stat_monitor_settings ORDER BY name COLLATE "C"; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes diff --git a/t/expected/001_settings_default.out b/t/expected/001_settings_default.out index 3886fc6..eefd15b 100644 --- a/t/expected/001_settings_default.out +++ b/t/expected/001_settings_default.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -62,7 +62,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/002_settings_pgsm_track_planning.out b/t/expected/002_settings_pgsm_track_planning.out index 2457b5d..a1a4a44 100644 --- a/t/expected/002_settings_pgsm_track_planning.out +++ b/t/expected/002_settings_pgsm_track_planning.out @@ -9,18 +9,18 @@ SELECT * from pg_stat_monitor_settings; name | value | default_value | description | minimum | maximum | options | restart ------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+--------- pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes - pg_stat_monitor.pgsm_query_max_len | 1024 | 1024 | Sets the maximum length of query. | 1024 | 2147483647 | | yes + pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no - pg_stat_monitor.pgsm_track | all | all | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no + pg_stat_monitor.pgsm_track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no pg_stat_monitor.pgsm_track_planning | yes | no | Selects whether planning statistics are tracked. | | | yes, no | no (15 rows) @@ -29,18 +29,18 @@ SELECT * from pg_stat_monitor_settings; name | value | default_value | description | minimum | maximum | options | restart ------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+--------- pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes - pg_stat_monitor.pgsm_query_max_len | 1024 | 1024 | Sets the maximum length of query. | 1024 | 2147483647 | | yes + pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no - pg_stat_monitor.pgsm_track | all | all | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no + pg_stat_monitor.pgsm_track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no pg_stat_monitor.pgsm_track_planning | yes | no | Selects whether planning statistics are tracked. | | | yes, no | no (15 rows) @@ -48,9 +48,9 @@ SELECT * from pg_stat_monitor_settings; SELECT query, calls, total_plan_time, min_plan_time, max_plan_time, mean_plan_time, stddev_plan_time from pg_stat_monitor; query | calls | total_plan_time | min_plan_time | max_plan_time | mean_plan_time | stddev_plan_time ---------------------------------------------------------------------------------------------------------------------------+-------+-----------------+---------------+---------------+----------------+------------------ - SELECT * from pg_stat_monitor_settings | 2 | 0.4454 | 0.2148 | 0.2307 | 0.2227 | 0.0079 - SELECT query, calls, total_plan_time, min_plan_time, max_plan_time, mean_plan_time, stddev_plan_time from pg_stat_monitor | 1 | 1.1586 | 1.1586 | 1.1586 | 1.1586 | 0 + SELECT * from pg_stat_monitor_settings | 2 | 0.2275 | 0.1088 | 0.1187 | 0.1138 | 0.0049 SELECT pg_stat_monitor_reset() | 1 | 0 | 0 | 0 | 0 | 0 + SELECT query, calls, total_plan_time, min_plan_time, max_plan_time, mean_plan_time, stddev_plan_time from pg_stat_monitor | 1 | 1.0944 | 1.0944 | 1.0944 | 1.0944 | 0 (3 rows) SELECT pg_stat_monitor_reset(); @@ -63,18 +63,18 @@ SELECT * from pg_stat_monitor_settings; name | value | default_value | description | minimum | maximum | options | restart ------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+--------- pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes - pg_stat_monitor.pgsm_query_max_len | 1024 | 1024 | Sets the maximum length of query. | 1024 | 2147483647 | | yes + pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no - pg_stat_monitor.pgsm_track | all | all | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no + pg_stat_monitor.pgsm_track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no pg_stat_monitor.pgsm_track_planning | no | no | Selects whether planning statistics are tracked. | | | yes, no | no (15 rows) @@ -83,18 +83,18 @@ SELECT * from pg_stat_monitor_settings; name | value | default_value | description | minimum | maximum | options | restart ------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+--------- pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes - pg_stat_monitor.pgsm_query_max_len | 1024 | 1024 | Sets the maximum length of query. | 1024 | 2147483647 | | yes + pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no - pg_stat_monitor.pgsm_track | all | all | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no + pg_stat_monitor.pgsm_track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no pg_stat_monitor.pgsm_track_planning | no | no | Selects whether planning statistics are tracked. | | | yes, no | no (15 rows) @@ -103,8 +103,8 @@ SELECT query, calls, total_plan_time, min_plan_time, max_plan_time, mean_plan_ti query | calls | total_plan_time | min_plan_time | max_plan_time | mean_plan_time | stddev_plan_time ---------------------------------------------------------------------------------------------------------------------------+-------+-----------------+---------------+---------------+----------------+------------------ SELECT * from pg_stat_monitor_settings | 2 | 0 | 0 | 0 | 0 | 0 - SELECT query, calls, total_plan_time, min_plan_time, max_plan_time, mean_plan_time, stddev_plan_time from pg_stat_monitor | 1 | 0 | 0 | 0 | 0 | 0 SELECT pg_stat_monitor_reset() | 1 | 0 | 0 | 0 | 0 | 0 + SELECT query, calls, total_plan_time, min_plan_time, max_plan_time, mean_plan_time, stddev_plan_time from pg_stat_monitor | 1 | 0 | 0 | 0 | 0 | 0 (3 rows) select substr(query, 0,100) as query, calls, total_plan_time, min_plan_time,max_plan_time,mean_plan_time,stddev_plan_time from pg_stat_monitor order by query; diff --git a/t/expected/003_settings_pgms_extract_comments.out b/t/expected/003_settings_pgms_extract_comments.out index ab626aa..29f4c24 100644 --- a/t/expected/003_settings_pgms_extract_comments.out +++ b/t/expected/003_settings_pgms_extract_comments.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -57,7 +57,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/004_settings_pgsm_track.out b/t/expected/004_settings_pgsm_track.out index 10be3d3..99353c1 100644 --- a/t/expected/004_settings_pgsm_track.out +++ b/t/expected/004_settings_pgsm_track.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -42,7 +42,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -68,7 +68,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/005_settings_pgsm_enable_query_plan.out b/t/expected/005_settings_pgsm_enable_query_plan.out index 17363a2..ea6f7df 100644 --- a/t/expected/005_settings_pgsm_enable_query_plan.out +++ b/t/expected/005_settings_pgsm_enable_query_plan.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | yes | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -69,7 +69,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/006_settings_pgsm_overflow_target.out b/t/expected/006_settings_pgsm_overflow_target.out index b580af6..9d5edbe 100644 --- a/t/expected/006_settings_pgsm_overflow_target.out +++ b/t/expected/006_settings_pgsm_overflow_target.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 0 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -42,7 +42,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/007_settings_pgsm_query_shared_buffer.out b/t/expected/007_settings_pgsm_query_shared_buffer.out index 7f7e3a1..426e6c8 100644 --- a/t/expected/007_settings_pgsm_query_shared_buffer.out +++ b/t/expected/007_settings_pgsm_query_shared_buffer.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 1 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -68,7 +68,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 100 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -94,7 +94,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/008_settings_pgsm_histogram_buckets.out b/t/expected/008_settings_pgsm_histogram_buckets.out index 581ac97..b8c70db 100644 --- a/t/expected/008_settings_pgsm_histogram_buckets.out +++ b/t/expected/008_settings_pgsm_histogram_buckets.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10000 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -42,7 +42,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 1000 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -68,7 +68,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 100 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -94,7 +94,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -120,7 +120,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/009_settings_pgsm_histogram_max.out b/t/expected/009_settings_pgsm_histogram_max.out index 82d067e..2a92198 100644 --- a/t/expected/009_settings_pgsm_histogram_max.out +++ b/t/expected/009_settings_pgsm_histogram_max.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -42,7 +42,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 10 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -68,7 +68,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -94,7 +94,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 1000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/010_settings_pgsm_histogram_min.out b/t/expected/010_settings_pgsm_histogram_min.out index 254b7db..6d64979 100644 --- a/t/expected/010_settings_pgsm_histogram_min.out +++ b/t/expected/010_settings_pgsm_histogram_min.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 1 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -42,7 +42,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 1000 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -68,7 +68,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 10000 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -94,7 +94,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 99999 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/011_settings_pgsm_bucket_time.out b/t/expected/011_settings_pgsm_bucket_time.out index ac3491f..6b9afff 100644 --- a/t/expected/011_settings_pgsm_bucket_time.out +++ b/t/expected/011_settings_pgsm_bucket_time.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 10000 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -42,7 +42,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 1000 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -68,7 +68,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 100 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -94,7 +94,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -120,7 +120,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 1 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -146,7 +146,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/012_settings_pgsm_max_buckets.out b/t/expected/012_settings_pgsm_max_buckets.out index 23ddb42..4191caf 100644 --- a/t/expected/012_settings_pgsm_max_buckets.out +++ b/t/expected/012_settings_pgsm_max_buckets.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -42,7 +42,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -68,7 +68,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -94,7 +94,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -120,7 +120,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -146,7 +146,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/013_settings_pgsm_normalized_query.out b/t/expected/013_settings_pgsm_normalized_query.out index 4e8f695..66e2c37 100644 --- a/t/expected/013_settings_pgsm_normalized_query.out +++ b/t/expected/013_settings_pgsm_normalized_query.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -70,7 +70,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/014_settings_pgsm_track_utility.out b/t/expected/014_settings_pgsm_track_utility.out index ecb2c5e..21029ec 100644 --- a/t/expected/014_settings_pgsm_track_utility.out +++ b/t/expected/014_settings_pgsm_track_utility.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -70,7 +70,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/015_settings_pgsm_query_max_len.out b/t/expected/015_settings_pgsm_query_max_len.out index 2fa5ec1..d428738 100644 --- a/t/expected/015_settings_pgsm_query_max_len.out +++ b/t/expected/015_settings_pgsm_query_max_len.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -42,7 +42,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -68,7 +68,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -94,7 +94,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -120,7 +120,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/016_settings_pgsm_max.out b/t/expected/016_settings_pgsm_max.out index f334140..c51da95 100644 --- a/t/expected/016_settings_pgsm_max.out +++ b/t/expected/016_settings_pgsm_max.out @@ -16,7 +16,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -42,7 +42,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -68,7 +68,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -94,7 +94,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no @@ -120,7 +120,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no diff --git a/t/expected/017_execution_stats.out b/t/expected/017_execution_stats.out index 61138af..6f2eb7a 100644 --- a/t/expected/017_execution_stats.out +++ b/t/expected/017_execution_stats.out @@ -9,19 +9,19 @@ SELECT * from pg_stat_monitor_settings; name | value | default_value | description | minimum | maximum | options | restart ------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+--------- pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes - pg_stat_monitor.pgsm_query_max_len | 1024 | 1024 | Sets the maximum length of query. | 1024 | 2147483647 | | yes + pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no - pg_stat_monitor.track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no - pg_stat_monitor.extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no + pg_stat_monitor.pgsm_track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no + pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no pg_stat_monitor.pgsm_track_planning | no | no | Selects whether planning statistics are tracked. | | | yes, no | no (15 rows) @@ -29,22 +29,30 @@ SELECT * from pg_stat_monitor_settings; name | value | default_value | description | minimum | maximum | options | restart ------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+--------- pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes - pg_stat_monitor.pgsm_query_max_len | 1024 | 1024 | Sets the maximum length of query. | 1024 | 2147483647 | | yes + pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 2147483647 | | yes + pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no - pg_stat_monitor.track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no - pg_stat_monitor.extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no + pg_stat_monitor.pgsm_track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no + pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no pg_stat_monitor.pgsm_track_planning | no | no | Selects whether planning statistics are tracked. | | | yes, no | no (15 rows) +SELECT query, calls, total_exec_time, min_exec_time, max_exec_time, mean_exec_time, stddev_exec_time from pg_stat_monitor; + query | calls | total_exec_time | min_exec_time | max_exec_time | mean_exec_time | stddev_exec_time +---------------------------------------------------------------------------------------------------------------------------+-------+-----------------+---------------+---------------+----------------+------------------ + SELECT * from pg_stat_monitor_settings | 2 | 0.0736 | 0.0341 | 0.0396 | 0.0368 | 0.0028 + SELECT query, calls, total_exec_time, min_exec_time, max_exec_time, mean_exec_time, stddev_exec_time from pg_stat_monitor | 1 | 0 | 0 | 0 | 0 | 0 + SELECT pg_stat_monitor_reset() | 1 | 0.03 | 0.03 | 0.03 | 0.03 | 0 +(3 rows) + SELECT pg_stat_monitor_reset(); pg_stat_monitor_reset ----------------------- From 6d2a81ebddb4ceb219fac1d9a820f29d18adfa67 Mon Sep 17 00:00:00 2001 From: Kai Wagner Date: Tue, 24 May 2022 10:50:42 +0200 Subject: [PATCH 14/28] PG-375: only run code coverage test on merge Signed-off-by: Kai Wagner --- .github/workflows/coverage_test.yml | 11 ++++++++--- .github/workflows/postgresql-14-build.yml | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage_test.yml b/.github/workflows/coverage_test.yml index b963636..1e6098f 100644 --- a/.github/workflows/coverage_test.yml +++ b/.github/workflows/coverage_test.yml @@ -1,8 +1,13 @@ -name: coverage-test -on: ["push", "pull_request"] +name: coverage_test +on: + pull_request: + types: + - closed jobs: - build: + if_merged: + if: github.event.pull_request.merged == true + build: name: coverage-test runs-on: ubuntu-latest steps: diff --git a/.github/workflows/postgresql-14-build.yml b/.github/workflows/postgresql-14-build.yml index 61347fa..e28162b 100644 --- a/.github/workflows/postgresql-14-build.yml +++ b/.github/workflows/postgresql-14-build.yml @@ -1,5 +1,5 @@ name: postgresql-14-build -on: [push] +on: ["push", "pull_request"] jobs: build: From de9a915a9781978ca7313ddce9d293bdeb55a9cc Mon Sep 17 00:00:00 2001 From: Kai Wagner Date: Wed, 25 May 2022 14:40:49 +0200 Subject: [PATCH 15/28] PG-420: PGSM-1.0.1 release notes Signed-off-by: Kai Wagner --- docs/RELEASE_NOTES.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index db2c401..301b35d 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -2,6 +2,16 @@ Below is the complete list of release notes for every version of ``pg_stat_monitor``. +## 1.0.1 + +### Bugs Fixed + +[PG-382](https://jira.percona.com/browse/PG-382): Histogram default settings changed to prevent the PostgreSQL server to crash + +[PG-417](https://jira.percona.com/browse/PG-417): Addressed security vulnerabilities to prevent an attacker from precreating functions + +[DISTPG-427](https://jira.percona.com/browse/DISTPG-427): Fixed the issue with the extensions not working when pg_stat_monitor is enabled by replacing the `return` with `goto exit` for the `pgsm_emit_log_hook` function + ## 1.0.0 Bump version from 1.0.0-rc.2 to 1.0.0. From 85868161941eeb4cabbf12b5b6dcf0a7fc61e3c0 Mon Sep 17 00:00:00 2001 From: Kai Wagner Date: Wed, 25 May 2022 17:43:11 +0200 Subject: [PATCH 16/28] PG-424: bump version to 1.0.1 (#235) Signed-off-by: Kai Wagner --- META.json | 4 ++-- pg_stat_monitor.c | 2 +- regression/expected/version.out | 2 +- rpm/pg-stat-monitor.spec | 3 +++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/META.json b/META.json index bcc3fdb..6f7f646 100644 --- a/META.json +++ b/META.json @@ -2,7 +2,7 @@ "name": "pg_stat_monitor", "abstract": "PostgreSQL Query Performance Monitoring Tool", "description": "pg_stat_monitor is a PostgreSQL Query Performance Monitoring tool, based on PostgreSQL's contrib module pg_stat_statements. PostgreSQL’s pg_stat_statements provides the basic statistics, which is sometimes not enough. The major shortcoming in pg_stat_statements is that it accumulates all the queries and their statistics and does not provide aggregated statistics nor histogram information. In this case, a user would need to calculate the aggregates, which is quite an expensive operation.", - "version": "1.0.0", + "version": "1.0.1", "maintainer": [ "ibrar.ahmed@percona.com" ], @@ -12,7 +12,7 @@ "abstract": "PostgreSQL Query Performance Monitoring Tool", "file": "pg_stat_monitor--1.0.sql", "docfile": "README.md", - "version": "1.0.0" + "version": "1.0.1" } }, "prereqs": { diff --git a/pg_stat_monitor.c b/pg_stat_monitor.c index f1434a4..38eea35 100644 --- a/pg_stat_monitor.c +++ b/pg_stat_monitor.c @@ -27,7 +27,7 @@ PG_MODULE_MAGIC; -#define BUILD_VERSION "1.0.0" +#define BUILD_VERSION "1.0.1" #define PG_STAT_STATEMENTS_COLS 53 /* maximum of above */ #define PGSM_TEXT_FILE "/tmp/pg_stat_monitor_query" diff --git a/regression/expected/version.out b/regression/expected/version.out index ab1dd21..225c3fe 100644 --- a/regression/expected/version.out +++ b/regression/expected/version.out @@ -2,7 +2,7 @@ CREATE EXTENSION pg_stat_monitor; SELECT pg_stat_monitor_version(); pg_stat_monitor_version ------------------------- - 1.0.0 + 1.0.1 (1 row) DROP EXTENSION pg_stat_monitor; diff --git a/rpm/pg-stat-monitor.spec b/rpm/pg-stat-monitor.spec index e4c852c..4c5ea17 100644 --- a/rpm/pg-stat-monitor.spec +++ b/rpm/pg-stat-monitor.spec @@ -65,5 +65,8 @@ sed -i 's:PG_CONFIG = pg_config:PG_CONFIG = /usr/pgsql-%{pgrel}/bin/pg_config:' %changelog +* Thu May 26 2022 Kai Wagner - 1.0.1-1 +- First patch release + * Wed Nov 17 2021 Evgeniy Patlan - 1.0.0-1 - Initial build From 4a2dd52bc0bd43620890f9e89360b14229637061 Mon Sep 17 00:00:00 2001 From: Ibrar Ahmed Date: Thu, 26 May 2022 23:03:39 +0500 Subject: [PATCH 17/28] README Update. (#243) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the coverage badge repo. Co-authored-by: Ibrar Ahmed <“ibrar.ahmed@percona.com”> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2219b3a..7534f26 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ -[![Coverage Status](https://coveralls.io/repos/github/percona/pg_stat_monitor/badge.svg?branch=REL1_0_STABLE)](https://coveralls.io/github/percona/pg_stat_monitor?branch=REL1_0_STABLE) +[![Coverage Status](https://coveralls.io/repos/github/percona/pg_stat_monitor/badge.svg?branch=REL_1_STABLE)](https://coveralls.io/github/percona/pg_stat_monitor?branch=REL_1_STABLE) # pg_stat_monitor: Query Performance Monitoring Tool for PostgreSQL ## Table of Contents From 8330ecdaf2be3eaee05a4a1ac88fc287a59c3929 Mon Sep 17 00:00:00 2001 From: Ibrar Ahmed Date: Fri, 27 May 2022 00:04:13 +0500 Subject: [PATCH 18/28] README Update. (#244) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ibrar Ahmed <“ibrar.ahmed@percona.com”> --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7534f26..eac1a52 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -![PostgreSQL-11](https://github.com/percona/pg_stat_monitor/workflows/postgresql-11-build/badge.svg) ![PostgreSQL-11-Package](https://github.com/percona/pg_stat_monitor/workflows/postgresql-11-package/badge.svg) ![PostgreSQL-12](https://github.com/percona/pg_stat_monitor/workflows/postgresql-12-build/badge.svg) ![PostgreSQL-12-Package](https://github.com/percona/pg_stat_monitor/workflows/postgresql-12-package/badge.svg) - -![PostgreSQL-13](https://github.com/percona/pg_stat_monitor/workflows/postgresql-13-build/badge.svg) ![PostgreSQL-13-Package](https://github.com/percona/pg_stat_monitor/workflows/postgresql-13-package/badge.svg) ![PostgreSQL-14](https://github.com/percona/pg_stat_monitor/workflows/postgresql-14-build/badge.svg) +![PostgreSQL-11](https://github.com/percona/pg_stat_monitor/workflows/postgresql-11-build/badge.svg?branch=REL_1_STABLE) ![PostgreSQL-11-Package](https://github.com/percona/pg_stat_monitor/workflows/postgresql-11-package/badge.svg) ![PostgreSQL-12](https://github.com/percona/pg_stat_monitor/workflows/postgresql-12-build/badge.svg?branch=REL_1_STABLE) ![PostgreSQL-12-Package](https://github.com/percona/pg_stat_monitor/workflows/postgresql-12-package/badge.svg) +![PostgreSQL-13](https://github.com/percona/pg_stat_monitor/workflows/postgresql-13-build/badge.svg?branch=REL_1_STABLE) ![PostgreSQL-13-Package](https://github.com/percona/pg_stat_monitor/workflows/postgresql-13-package/badge.svg) ![PostgreSQL-14](https://github.com/percona/pg_stat_monitor/workflows/postgresql-14-build/badge.svg?branch=REL_1_STABLE) +[![postgresql-11-build](https://github.com/percona/pg_stat_monitor/actions/workflows/postgresql-11-build.yml/badge.svg?branch=REL_1_STABLE)](https://github.com/percona/pg_stat_monitor/actions/workflows/postgresql-11-build.yml) [![Coverage Status](https://coveralls.io/repos/github/percona/pg_stat_monitor/badge.svg?branch=REL_1_STABLE)](https://coveralls.io/github/percona/pg_stat_monitor?branch=REL_1_STABLE) # pg_stat_monitor: Query Performance Monitoring Tool for PostgreSQL From ce9eca0fc61f5bc8b744a691c53f39aef7351271 Mon Sep 17 00:00:00 2001 From: Anastasia Alexadrova Date: Mon, 30 May 2022 11:44:46 +0200 Subject: [PATCH 19/28] PG-432 Fixed branch name of a GH action modified: .github/workflows/doc-build.yml --- .github/workflows/doc-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 32eece5..aed5146 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -2,7 +2,7 @@ name: Build pg_stat_monitor docs on: push: branches: - - REL1_0_STABLE + - REL_1_STABLE jobs: @@ -44,7 +44,7 @@ jobs: # Deploy docs - name: Deploy docs run: | - mike deploy REL1_0_STABLE -p - mike set-default REL1_0_STABLE -p - mike retitle REL1_0_STABLE "1.0.x (stable)" -p + mike deploy REL_1_STABLE -p + mike set-default REL_1_STABLE -p + mike retitle REL_1_STABLE "1.0.x (stable)" -p From 9f7aac6810f807e65591c6cd01d7a282c3db9c10 Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Wed, 1 Jun 2022 17:23:58 +0530 Subject: [PATCH 20/28] PMM-9951 Adding PGSM+PMM Integration tests (#249) --- .github/workflows/postgresql-11-pmm.yaml | 41 ++++++++++++++++++++++ .github/workflows/postgresql-12-pmm.yaml | 41 ++++++++++++++++++++++ .github/workflows/postgresql-13-pmm.yaml | 44 ++++++++++++++++++++++++ .github/workflows/postgresql-14-pmm.yaml | 41 ++++++++++++++++++++++ 4 files changed, 167 insertions(+) create mode 100644 .github/workflows/postgresql-11-pmm.yaml create mode 100644 .github/workflows/postgresql-12-pmm.yaml create mode 100644 .github/workflows/postgresql-13-pmm.yaml create mode 100644 .github/workflows/postgresql-14-pmm.yaml diff --git a/.github/workflows/postgresql-11-pmm.yaml b/.github/workflows/postgresql-11-pmm.yaml new file mode 100644 index 0000000..43c57fc --- /dev/null +++ b/.github/workflows/postgresql-11-pmm.yaml @@ -0,0 +1,41 @@ +name: postgresql-11-pmm-integration +on: pull_request + +jobs: + build: + name: pg-11-pgsm-pmm-integration-test + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Clone QA Integration repository + uses: actions/checkout@v2 + with: + repository: 'Percona-Lab/qa-integration' + ref: 'main' + + # print branch name + - name: Get branch name + run: echo 'The branch name is' ${{ github.head_ref }} + + - name: Run PMM & PGSM Setup, E2E Tests + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=11 --pgstat-monitor-branch=${{ github.head_ref }} + + - name: Test Report + uses: dorny/test-reporter@v1 + if: success() || failure() # run this step even if previous step failed + with: + name: Codeceptjs E2E Tests # Name of the check run which will be created + path: ./pmm-ui-tests/tests/output/*.xml # Path to test results + reporter: java-junit + + - name: Get PMM-Agent Logs from the Container + if: success() || failure() # run this step even if previous step failed + run: docker exec pgsql_pgsm_11 cat pmm-agent.log > ./pmm-ui-tests/tests/output/pmm-agent.log + + - name: Upload Tests Artifacts + uses: actions/upload-artifact@v3 + if: success() || failure() # run this step even if previous step failed + with: + name: tests-artifact + path: ./pmm-ui-tests/tests/output/ + if-no-files-found: ignore # 'warn' or 'ignore' are also available, defaults to `warn` diff --git a/.github/workflows/postgresql-12-pmm.yaml b/.github/workflows/postgresql-12-pmm.yaml new file mode 100644 index 0000000..c28324e --- /dev/null +++ b/.github/workflows/postgresql-12-pmm.yaml @@ -0,0 +1,41 @@ +name: postgresql-12-pmm-integration +on: pull_request + +jobs: + build: + name: pg-12-pgsm-pmm-integration-test + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Clone QA Integration repository + uses: actions/checkout@v2 + with: + repository: 'Percona-Lab/qa-integration' + ref: 'main' + + # print branch name + - name: Get branch name + run: echo 'The branch name is' ${{ github.head_ref }} + + - name: Run PMM & PGSM Setup, E2E Tests + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=12 --pgstat-monitor-branch=${{ github.head_ref }} + + - name: Test Report + uses: dorny/test-reporter@v1 + if: success() || failure() # run this step even if previous step failed + with: + name: Codeceptjs E2E Tests # Name of the check run which will be created + path: ./pmm-ui-tests/tests/output/*.xml # Path to test results + reporter: java-junit + + - name: Get PMM-Agent Logs from the Container + if: success() || failure() # run this step even if previous step failed + run: docker exec pgsql_pgsm_12 cat pmm-agent.log > ./pmm-ui-tests/tests/output/pmm-agent.log + + - name: Upload Tests Artifacts + uses: actions/upload-artifact@v3 + if: success() || failure() # run this step even if previous step failed + with: + name: tests-artifact + path: ./pmm-ui-tests/tests/output/ + if-no-files-found: ignore # 'warn' or 'ignore' are also available, defaults to `warn` diff --git a/.github/workflows/postgresql-13-pmm.yaml b/.github/workflows/postgresql-13-pmm.yaml new file mode 100644 index 0000000..bc71a38 --- /dev/null +++ b/.github/workflows/postgresql-13-pmm.yaml @@ -0,0 +1,44 @@ +name: postgresql-13-pmm-integration +on: pull_request + +jobs: + build: + name: pg-13-pgsm-pmm-integration-test + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Clone QA Integration repository + uses: actions/checkout@v2 + with: + repository: 'Percona-Lab/qa-integration' + ref: 'main' + + # print branch name + - name: Get branch name + run: echo 'The branch name is' ${{ github.head_ref }} + + - name: Get current path + run: pwd + + - name: Run PMM & PGSM Setup, E2E Tests + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=13 --pgstat-monitor-branch=${{ github.head_ref }} + + - name: Test Report + uses: dorny/test-reporter@v1 + if: success() || failure() # run this step even if previous step failed + with: + name: Codeceptjs E2E Tests # Name of the check run which will be created + path: ./pmm-ui-tests/tests/output/*.xml # Path to test results + reporter: java-junit + + - name: Get PMM-Agent Logs from the Container + if: success() || failure() # run this step even if previous step failed + run: docker exec pgsql_pgsm_13 cat pmm-agent.log > ./pmm-ui-tests/tests/output/pmm-agent.log + + - name: Upload Tests Artifacts + uses: actions/upload-artifact@v3 + if: success() || failure() # run this step even if previous step failed + with: + name: tests-artifact + path: ./pmm-ui-tests/tests/output/ + if-no-files-found: ignore # 'warn' or 'ignore' are also available, defaults to `warn` diff --git a/.github/workflows/postgresql-14-pmm.yaml b/.github/workflows/postgresql-14-pmm.yaml new file mode 100644 index 0000000..c518407 --- /dev/null +++ b/.github/workflows/postgresql-14-pmm.yaml @@ -0,0 +1,41 @@ +name: postgresql-14-pmm-integration +on: pull_request + +jobs: + build: + name: pg-14-pgsm-pmm-integration-test + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Clone QA Integration repository + uses: actions/checkout@v2 + with: + repository: 'Percona-Lab/qa-integration' + ref: 'main' + + # print branch name + - name: Get branch name + run: echo 'The branch name is' ${{ github.head_ref }} + + - name: Run PMM & PGSM Setup, E2E Tests + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=14 --pgstat-monitor-branch=${{ github.head_ref }} + + - name: Test Report + uses: dorny/test-reporter@v1 + if: success() || failure() # run this step even if previous step failed + with: + name: Codeceptjs E2E Tests # Name of the check run which will be created + path: ./pmm-ui-tests/tests/output/*.xml # Path to test results + reporter: java-junit + + - name: Get PMM-Agent Logs from the Container + if: success() || failure() # run this step even if previous step failed + run: docker exec pgsql_pgsm_14 cat pmm-agent.log > ./pmm-ui-tests/tests/output/pmm-agent.log + + - name: Upload Tests Artifacts + uses: actions/upload-artifact@v3 + if: success() || failure() # run this step even if previous step failed + with: + name: tests-artifact + path: ./pmm-ui-tests/tests/output/ + if-no-files-found: ignore # 'warn' or 'ignore' are also available, defaults to `warn` From 4f056813e0218991d0fafbedbb09c28294a2dc5e Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Fri, 3 Jun 2022 16:41:15 +0530 Subject: [PATCH 21/28] PMM-9951 Checking with forked repo and custom branch (#251) PMM-9951 Fix for forked Repo PMM-9951 Checking with forked repo and custom branch PMM-9951 fix the branch PMM-9951 testing the github properties PMM-9951 testing PMM-9951 testing the changes PMM-9951 changing permissions PMM-9951 handle the repo PMM-9951 permissions check PMM-9951 permissions check PMM-9951 remove not needed ones PMM-9951 checks permissions PMM-9951 testing PMM-9951 testing another workflow PMM-9951 test changes PMM-9951 Final Push with all changes PMM-9951 --- .github/workflows/postgresql-11-pmm.yaml | 18 +++++------------- .github/workflows/postgresql-12-pmm.yaml | 18 +++++------------- .github/workflows/postgresql-13-pmm.yaml | 21 +++++---------------- .github/workflows/postgresql-14-pmm.yaml | 18 +++++------------- .gitignore | 3 +++ 5 files changed, 23 insertions(+), 55 deletions(-) diff --git a/.github/workflows/postgresql-11-pmm.yaml b/.github/workflows/postgresql-11-pmm.yaml index 43c57fc..ca03432 100644 --- a/.github/workflows/postgresql-11-pmm.yaml +++ b/.github/workflows/postgresql-11-pmm.yaml @@ -5,7 +5,7 @@ jobs: build: name: pg-11-pgsm-pmm-integration-test runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 20 steps: - name: Clone QA Integration repository uses: actions/checkout@v2 @@ -13,20 +13,12 @@ jobs: repository: 'Percona-Lab/qa-integration' ref: 'main' - # print branch name - - name: Get branch name - run: echo 'The branch name is' ${{ github.head_ref }} + # print branch and Repo name + - name: Get branch and Repo Name + run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=11 --pgstat-monitor-branch=${{ github.head_ref }} - - - name: Test Report - uses: dorny/test-reporter@v1 - if: success() || failure() # run this step even if previous step failed - with: - name: Codeceptjs E2E Tests # Name of the check run which will be created - path: ./pmm-ui-tests/tests/output/*.xml # Path to test results - reporter: java-junit + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=11 --pgstat-monitor-branch=${{ github.head_ref }} --pgstat-monitor-repo=${{ github.actor }}/pg_stat_monitor - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed diff --git a/.github/workflows/postgresql-12-pmm.yaml b/.github/workflows/postgresql-12-pmm.yaml index c28324e..e5a1881 100644 --- a/.github/workflows/postgresql-12-pmm.yaml +++ b/.github/workflows/postgresql-12-pmm.yaml @@ -5,7 +5,7 @@ jobs: build: name: pg-12-pgsm-pmm-integration-test runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 20 steps: - name: Clone QA Integration repository uses: actions/checkout@v2 @@ -13,20 +13,12 @@ jobs: repository: 'Percona-Lab/qa-integration' ref: 'main' - # print branch name - - name: Get branch name - run: echo 'The branch name is' ${{ github.head_ref }} + # print branch and Repo name + - name: Get branch and Repo Name + run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=12 --pgstat-monitor-branch=${{ github.head_ref }} - - - name: Test Report - uses: dorny/test-reporter@v1 - if: success() || failure() # run this step even if previous step failed - with: - name: Codeceptjs E2E Tests # Name of the check run which will be created - path: ./pmm-ui-tests/tests/output/*.xml # Path to test results - reporter: java-junit + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=12 --pgstat-monitor-branch=${{ github.head_ref }} --pgstat-monitor-repo=${{ github.actor }}/pg_stat_monitor - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed diff --git a/.github/workflows/postgresql-13-pmm.yaml b/.github/workflows/postgresql-13-pmm.yaml index bc71a38..1ffbea7 100644 --- a/.github/workflows/postgresql-13-pmm.yaml +++ b/.github/workflows/postgresql-13-pmm.yaml @@ -5,7 +5,7 @@ jobs: build: name: pg-13-pgsm-pmm-integration-test runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 20 steps: - name: Clone QA Integration repository uses: actions/checkout@v2 @@ -13,23 +13,12 @@ jobs: repository: 'Percona-Lab/qa-integration' ref: 'main' - # print branch name - - name: Get branch name - run: echo 'The branch name is' ${{ github.head_ref }} - - - name: Get current path - run: pwd + # print branch and Repo name + - name: Get branch and Repo Name + run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=13 --pgstat-monitor-branch=${{ github.head_ref }} - - - name: Test Report - uses: dorny/test-reporter@v1 - if: success() || failure() # run this step even if previous step failed - with: - name: Codeceptjs E2E Tests # Name of the check run which will be created - path: ./pmm-ui-tests/tests/output/*.xml # Path to test results - reporter: java-junit + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=13 --pgstat-monitor-branch=${{ github.head_ref }} --pgstat-monitor-repo=${{ github.actor }}/pg_stat_monitor - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed diff --git a/.github/workflows/postgresql-14-pmm.yaml b/.github/workflows/postgresql-14-pmm.yaml index c518407..ca70e94 100644 --- a/.github/workflows/postgresql-14-pmm.yaml +++ b/.github/workflows/postgresql-14-pmm.yaml @@ -5,7 +5,7 @@ jobs: build: name: pg-14-pgsm-pmm-integration-test runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 20 steps: - name: Clone QA Integration repository uses: actions/checkout@v2 @@ -13,20 +13,12 @@ jobs: repository: 'Percona-Lab/qa-integration' ref: 'main' - # print branch name - - name: Get branch name - run: echo 'The branch name is' ${{ github.head_ref }} + # print branch and Repo name + - name: Get branch and Repo Name + run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=14 --pgstat-monitor-branch=${{ github.head_ref }} - - - name: Test Report - uses: dorny/test-reporter@v1 - if: success() || failure() # run this step even if previous step failed - with: - name: Codeceptjs E2E Tests # Name of the check run which will be created - path: ./pmm-ui-tests/tests/output/*.xml # Path to test results - reporter: java-junit + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=14 --pgstat-monitor-branch=${{ github.head_ref }} --pgstat-monitor-repo=${{ github.actor }}/pg_stat_monitor - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed diff --git a/.gitignore b/.gitignore index d7926f3..f8b1f92 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,6 @@ modules.order Module.symvers Mkfile.old dkms.conf + +## IDE +.idea \ No newline at end of file From 1b89fa1814cd9ecfc564fc68e93ed94f2218cb8b Mon Sep 17 00:00:00 2001 From: Ibrar Ahmed Date: Thu, 9 Jun 2022 16:13:43 +0500 Subject: [PATCH 22/28] =?UTF-8?q?PG-289:=20Remove=20=E2=80=98for=E2=80=99?= =?UTF-8?q?=20loop=20initial=20declarations.=20(#256)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pg_stat_monitor.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pg_stat_monitor.c b/pg_stat_monitor.c index 38eea35..9f3c5e3 100644 --- a/pg_stat_monitor.c +++ b/pg_stat_monitor.c @@ -728,7 +728,7 @@ pgss_ExecutorCheckPerms(List *rt, bool abort) num_relations = 0; - foreach(lr, rt) + foreach(lr, rt) { RangeTblEntry *rte = lfirst(lr); if (rte->rtekind != RTE_RELATION) @@ -1664,11 +1664,15 @@ pg_stat_monitor_reset(PG_FUNCTION_ARGS) *(uint64 *)pgss_qbuf = 0; #ifdef BENCHMARK - for (int i = STATS_START; i < STATS_END; ++i) { - pg_hook_stats[i].min_time = 0; - pg_hook_stats[i].max_time = 0; - pg_hook_stats[i].total_time = 0; - pg_hook_stats[i].ncalls = 0; + { + int i; + for (i = STATS_START; i < STATS_END; ++i) + { + pg_hook_stats[i].min_time = 0; + pg_hook_stats[i].max_time = 0; + pg_hook_stats[i].total_time = 0; + pg_hook_stats[i].ncalls = 0; + } } #endif LWLockRelease(pgss->lock); @@ -3399,8 +3403,9 @@ pg_stat_monitor_settings(PG_FUNCTION_ARGS) if (conf->type == PGC_ENUM) { + size_t i; strcat(options, conf->guc_options[0]); - for (size_t i = 1; i < conf->n_options; ++i) + for (i = 1; i < conf->n_options; ++i) { strcat(options, ", "); strcat(options, conf->guc_options[i]); From d5ce83738f1bc3a4345d1805384e7749563b6345 Mon Sep 17 00:00:00 2001 From: Ibrar Ahmed Date: Thu, 9 Jun 2022 16:13:58 +0500 Subject: [PATCH 23/28] PG-362: pgsm_normalized_query needs to be 0 by default. (#253) pg_stat_monitor.pgsm_normalized_query needs to be 0 by default because people will get Query examples. This is one of the main user-faced advantages of pgsm over pgss (pg_stat_statements). --- guc.c | 2 +- regression/expected/application_name.out | 2 +- .../expected/application_name_unique.out | 4 +- regression/expected/basic.out | 2 +- regression/expected/cmd_type.out | 4 +- regression/expected/error.out | 6 +- regression/expected/error_insert.out | 2 +- regression/expected/guc.out | 2 +- regression/expected/histogram.out | 15 ++--- regression/expected/histogram_1.out | 4 +- regression/expected/rows.out | 4 +- regression/expected/tags.out | 10 +-- regression/expected/top_query.out | 8 +-- t/expected/001_settings_default.out | 18 +++--- .../002_settings_pgsm_track_planning.out | 24 ++++---- .../003_settings_pgms_extract_comments.out | 28 ++++----- t/expected/004_settings_pgsm_track.out | 6 +- .../005_settings_pgsm_enable_query_plan.out | 14 ++--- .../006_settings_pgsm_overflow_target.out | 4 +- .../007_settings_pgsm_query_shared_buffer.out | 20 +++--- .../008_settings_pgsm_histogram_buckets.out | 10 +-- .../009_settings_pgsm_histogram_max.out | 8 +-- .../010_settings_pgsm_histogram_min.out | 8 +-- t/expected/011_settings_pgsm_bucket_time.out | 61 ++----------------- t/expected/017_execution_stats.out | 4 +- 25 files changed, 109 insertions(+), 161 deletions(-) diff --git a/guc.c b/guc.c index 50065db..f97674c 100644 --- a/guc.c +++ b/guc.c @@ -75,7 +75,7 @@ init_guc(void) conf[i] = (GucVariable) { .guc_name = "pg_stat_monitor.pgsm_normalized_query", .guc_desc = "Selects whether save query in normalized format.", - .guc_default = 1, + .guc_default = 0, .guc_min = 0, .guc_max = 0, .guc_restart = false, diff --git a/regression/expected/application_name.out b/regression/expected/application_name.out index e200c18..f170fec 100644 --- a/regression/expected/application_name.out +++ b/regression/expected/application_name.out @@ -14,7 +14,7 @@ SELECT 1 AS num; SELECT query,application_name FROM pg_stat_monitor ORDER BY query COLLATE "C"; query | application_name -------------------------------------------------------------------------------+----------------------------- - SELECT $1 AS num | pg_regress/application_name + SELECT 1 AS num | pg_regress/application_name SELECT pg_stat_monitor_reset() | pg_regress/application_name SELECT query,application_name FROM pg_stat_monitor ORDER BY query COLLATE "C" | pg_regress/application_name (3 rows) diff --git a/regression/expected/application_name_unique.out b/regression/expected/application_name_unique.out index 4598af4..3494efd 100644 --- a/regression/expected/application_name_unique.out +++ b/regression/expected/application_name_unique.out @@ -22,8 +22,8 @@ SELECT 1 AS num; SELECT query,application_name FROM pg_stat_monitor ORDER BY query, application_name COLLATE "C"; query | application_name -------------------------------------------------------------------------------------------------+------------------------------------ - SELECT $1 AS num | naeem - SELECT $1 AS num | psql + SELECT 1 AS num | naeem + SELECT 1 AS num | psql SELECT pg_stat_monitor_reset() | pg_regress/application_name_unique SELECT query,application_name FROM pg_stat_monitor ORDER BY query, application_name COLLATE "C" | psql Set application_name = 'naeem' | naeem diff --git a/regression/expected/basic.out b/regression/expected/basic.out index adea370..8289ecb 100644 --- a/regression/expected/basic.out +++ b/regression/expected/basic.out @@ -14,7 +14,7 @@ SELECT 1 AS num; SELECT query FROM pg_stat_monitor ORDER BY query COLLATE "C"; query -------------------------------------------------------------- - SELECT $1 AS num + SELECT 1 AS num SELECT pg_stat_monitor_reset() SELECT query FROM pg_stat_monitor ORDER BY query COLLATE "C" (3 rows) diff --git a/regression/expected/cmd_type.out b/regression/expected/cmd_type.out index 086d230..2c6fc66 100644 --- a/regression/expected/cmd_type.out +++ b/regression/expected/cmd_type.out @@ -30,13 +30,13 @@ SELECT query, cmd_type, cmd_type_text FROM pg_stat_monitor ORDER BY query COLLA CREATE TABLE t2 (b INTEGER) | 0 | DELETE FROM t1 | 4 | DELETE DROP TABLE t1 | 0 | - INSERT INTO t1 VALUES($1) | 3 | INSERT + INSERT INTO t1 VALUES(1) | 3 | INSERT SELECT a FROM t1 | 1 | SELECT SELECT b FROM t2 FOR UPDATE | 1 | SELECT SELECT pg_stat_monitor_reset() | 1 | SELECT SELECT query, cmd_type, cmd_type_text FROM pg_stat_monitor ORDER BY query COLLATE "C" | 1 | SELECT TRUNCATE t1 | 0 | - UPDATE t1 SET a = $1 | 2 | UPDATE + UPDATE t1 SET a = 2 | 2 | UPDATE (11 rows) SELECT pg_stat_monitor_reset(); diff --git a/regression/expected/error.out b/regression/expected/error.out index 2e3d8fa..7a61786 100644 --- a/regression/expected/error.out +++ b/regression/expected/error.out @@ -23,9 +23,9 @@ WARNING: warning message SELECT query, elevel, sqlcode, message FROM pg_stat_monitor ORDER BY query COLLATE "C",elevel; query | elevel | sqlcode | message -----------------------------------------------------------------------------------------------+--------+---------+----------------------------------- - ELECET * FROM unknown; | 20 | 42601 | syntax error at or near "ELECET" - SELECT * FROM unknown; | 20 | 42P01 | relation "unknown" does not exist - SELECT 1/0; | 20 | 22012 | division by zero + ELECET * FROM unknown; | 21 | 42601 | syntax error at or near "ELECET" + SELECT * FROM unknown; | 21 | 42P01 | relation "unknown" does not exist + SELECT 1/0; | 21 | 22012 | division by zero SELECT pg_stat_monitor_reset() | 0 | | SELECT query, elevel, sqlcode, message FROM pg_stat_monitor ORDER BY query COLLATE "C",elevel | 0 | | do $$ +| 0 | | diff --git a/regression/expected/error_insert.out b/regression/expected/error_insert.out index ca7ab1d..aa64f57 100644 --- a/regression/expected/error_insert.out +++ b/regression/expected/error_insert.out @@ -20,7 +20,7 @@ SELECT query, elevel, sqlcode, message FROM pg_stat_monitor ORDER BY query COLLA query | elevel | sqlcode | message -----------------------------------------------------------------------------------------------+--------+---------+--------------------------------------------------------------- Drop Table if exists Company | 0 | | - INSERT INTO Company(ID, Name) VALUES ($1, $2) | 0 | | + INSERT INTO Company(ID, Name) VALUES (1, 'Percona') | 0 | | INSERT INTO Company(ID, Name) VALUES (1, 'Percona'); | 21 | 23505 | duplicate key value violates unique constraint "company_pkey" SELECT pg_stat_monitor_reset() | 0 | | SELECT query, elevel, sqlcode, message FROM pg_stat_monitor ORDER BY query COLLATE "C",elevel | 0 | | diff --git a/regression/expected/guc.out b/regression/expected/guc.out index 7a71d9f..f6ce856 100644 --- a/regression/expected/guc.out +++ b/regression/expected/guc.out @@ -22,7 +22,7 @@ SELECT * FROM pg_stat_monitor_settings ORDER BY name COLLATE "C"; pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes diff --git a/regression/expected/histogram.out b/regression/expected/histogram.out index 75a93a0..7f40b6c 100644 --- a/regression/expected/histogram.out +++ b/regression/expected/histogram.out @@ -47,16 +47,17 @@ INFO: Sleep 5 seconds SELECT substr(query, 0,50) as query, calls, resp_calls FROM pg_stat_monitor ORDER BY query COLLATE "C"; query | calls | resp_calls ---------------------------------------------------+-------+----------------------- - SELECT pg_sleep(i) | 5 | {0,0,0,0,0,0,3,2,0,0} + SELECT pg_sleep(i) | 4 | {0,0,0,0,0,0,3,1,0,0} + SELECT pg_sleep(i) | 1 | {0,0,0,0,0,0,0,1,0,0} SELECT pg_stat_monitor_reset() | 1 | {1,0,0,0,0,0,0,0,0,0} - SELECT substr(query, $1,$2) as query, calls, resp | 1 | {1,0,0,0,0,0,0,0,0,0} + SELECT substr(query, 0,50) as query, calls, resp_ | 1 | {1,0,0,0,0,0,0,0,0,0} Set pg_stat_monitor.pgsm_track='all' | 1 | {1,0,0,0,0,0,0,0,0,0} - select run_pg_sleep($1) | 1 | {0,0,0,0,0,0,0,0,1,0} -(5 rows) + select run_pg_sleep(5) | 1 | {0,0,0,0,0,0,0,0,1,0} +(6 rows) select * from generate_histogram(); - range | freq | bar ---------------------+------+-------------------------------------------------------------------------------------------- + range | freq | bar +--------------------+------+-------------------------------- (0 - 3)} | 0 | (3 - 10)} | 0 | (10 - 31)} | 0 | @@ -64,7 +65,7 @@ select * from generate_histogram(); (100 - 316)} | 0 | (316 - 1000)} | 0 | (1000 - 3162)} | 3 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ - (3162 - 10000)} | 2 | ■■■■■■■■■■■■■■■■■■■■ + (3162 - 10000)} | 1 | ■■■■■■■■■■ (10000 - 31622)} | 0 | (31622 - 100000)} | 0 | (10 rows) diff --git a/regression/expected/histogram_1.out b/regression/expected/histogram_1.out index 44bd655..9a0eb91 100644 --- a/regression/expected/histogram_1.out +++ b/regression/expected/histogram_1.out @@ -49,9 +49,9 @@ SELECT substr(query, 0,50) as query, calls, resp_calls FROM pg_stat_monitor ORDE ---------------------------------------------------+-------+----------------------- SELECT pg_sleep(i) | 5 | {0,0,0,0,0,0,3,2,0,0} SELECT pg_stat_monitor_reset() | 1 | {1,0,0,0,0,0,0,0,0,0} - SELECT substr(query, $1,$2) as query, calls, resp | 1 | {1,0,0,0,0,0,0,0,0,0} + SELECT substr(query, 0,50) as query, calls, resp_ | 1 | {1,0,0,0,0,0,0,0,0,0} Set pg_stat_monitor.pgsm_track='all' | 1 | {1,0,0,0,0,0,0,0,0,0} - select run_pg_sleep($1) | 1 | {0,0,0,0,0,0,0,0,1,0} + select run_pg_sleep(5) | 1 | {0,0,0,0,0,0,0,0,1,0} (5 rows) select * from generate_histogram(); diff --git a/regression/expected/rows.out b/regression/expected/rows.out index c68a9d8..b648175 100644 --- a/regression/expected/rows.out +++ b/regression/expected/rows.out @@ -8544,11 +8544,11 @@ SELECT query, rows_retrieved FROM pg_stat_monitor ORDER BY query COLLATE "C"; query | rows_retrieved ------------------------------------------------------------------------------+---------------- SELECT * FROM t1 | 1000 - SELECT * FROM t1 LIMIT $1 | 10 + SELECT * FROM t1 LIMIT 10 | 10 SELECT * FROM t2 | 5000 SELECT pg_stat_monitor_reset() | 1 SELECT query, rows_retrieved FROM pg_stat_monitor ORDER BY query COLLATE "C" | 0 - SELECt * FROM t2 WHERE b % $1 = $2 | 2500 + SELECt * FROM t2 WHERE b % 2 = 0 | 2500 (6 rows) SELECT pg_stat_monitor_reset(); diff --git a/regression/expected/tags.out b/regression/expected/tags.out index 27d37d3..6fd2de5 100644 --- a/regression/expected/tags.out +++ b/regression/expected/tags.out @@ -12,11 +12,11 @@ SELECT 1 AS num /* { "application", psql_app, "real_ip", 192.168.1.3) */; (1 row) SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C"; - query | comments ----------------------------------------------------------------------------+---------------------------------------------------------- - SELECT $1 AS num /* { "application", psql_app, "real_ip", 192.168.1.3) */ | /* { "application", psql_app, "real_ip", 192.168.1.3) */ - SELECT pg_stat_monitor_reset() | - SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C" | + query | comments +--------------------------------------------------------------------------+---------------------------------------------------------- + SELECT 1 AS num /* { "application", psql_app, "real_ip", 192.168.1.3) */ | /* { "application", psql_app, "real_ip", 192.168.1.3) */ + SELECT pg_stat_monitor_reset() | + SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C" | (3 rows) SELECT pg_stat_monitor_reset(); diff --git a/regression/expected/top_query.out b/regression/expected/top_query.out index dfc07f8..c943685 100644 --- a/regression/expected/top_query.out +++ b/regression/expected/top_query.out @@ -24,9 +24,9 @@ SELECT add2(1,2); (1 row) SELECT query, top_query FROM pg_stat_monitor ORDER BY query COLLATE "C"; - query | top_query --------------------------------------------------------------------------+-------------------- - (select $1 + $2) | SELECT add2($1,$2) + query | top_query +-------------------------------------------------------------------------+------------------ + (select $1 + $2) | SELECT add2(1,2) CREATE OR REPLACE FUNCTION add(int, int) RETURNS INTEGER AS +| $$ +| BEGIN +| @@ -38,7 +38,7 @@ SELECT query, top_query FROM pg_stat_monitor ORDER BY query COLLATE "C"; return add($1,$2); +| END; +| $$ language plpgsql | - SELECT add2($1,$2) | + SELECT add2(1,2) | SELECT pg_stat_monitor_reset() | SELECT query, top_query FROM pg_stat_monitor ORDER BY query COLLATE "C" | (6 rows) diff --git a/t/expected/001_settings_default.out b/t/expected/001_settings_default.out index eefd15b..5d3ad73 100644 --- a/t/expected/001_settings_default.out +++ b/t/expected/001_settings_default.out @@ -11,7 +11,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -31,11 +31,11 @@ select datname, substr(query,0,100) as query, calls from pg_stat_monitor order b ---------+-----------------------------------------------------------------------------------------------------+------- example | BEGIN | 10000 example | END | 10000 - example | INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES ($1, $2, $3, $4, CURRENT_TIMESTAMP | 10000 - example | SELECT abalance FROM pgbench_accounts WHERE aid = $1 | 10000 - example | UPDATE pgbench_accounts SET abalance = abalance + $1 WHERE aid = $2 | 10000 - example | UPDATE pgbench_branches SET bbalance = bbalance + $1 WHERE bid = $2 | 10000 - example | UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2 | 10000 + example | INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (18, 4, 559735, 3884, CURRENT_TIME | 10000 + example | SELECT abalance FROM pgbench_accounts WHERE aid = 302191 | 10000 + example | UPDATE pgbench_accounts SET abalance = abalance + 850 WHERE aid = 142401 | 10000 + example | UPDATE pgbench_branches SET bbalance = bbalance + 3884 WHERE bid = 4 | 10000 + example | UPDATE pgbench_tellers SET tbalance = tbalance + 3884 WHERE tid = 18 | 10000 example | alter table pgbench_accounts add primary key (aid) | 1 example | alter table pgbench_branches add primary key (bid) | 1 example | alter table pgbench_tellers add primary key (tid) | 1 @@ -47,8 +47,8 @@ select datname, substr(query,0,100) as query, calls from pg_stat_monitor order b example | create table pgbench_history(tid int,bid int,aid int,delta int,mtime timestamp,filler char(22)) | 1 example | create table pgbench_tellers(tid int not null,bid int,tbalance int,filler char(84)) with (fillfacto | 1 example | drop table if exists pgbench_accounts, pgbench_branches, pgbench_history, pgbench_tellers | 1 - example | insert into pgbench_branches(bid,bbalance) values($1,$2) | 10 - example | insert into pgbench_tellers(tid,bid,tbalance) values ($1,$2,$3) | 100 + example | insert into pgbench_branches(bid,bbalance) values(1,0) | 10 + example | insert into pgbench_tellers(tid,bid,tbalance) values (1,1,0) | 100 (20 rows) SELECT * from pg_stat_monitor_settings; @@ -57,7 +57,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes diff --git a/t/expected/002_settings_pgsm_track_planning.out b/t/expected/002_settings_pgsm_track_planning.out index a1a4a44..12a0538 100644 --- a/t/expected/002_settings_pgsm_track_planning.out +++ b/t/expected/002_settings_pgsm_track_planning.out @@ -11,7 +11,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -31,7 +31,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -48,9 +48,9 @@ SELECT * from pg_stat_monitor_settings; SELECT query, calls, total_plan_time, min_plan_time, max_plan_time, mean_plan_time, stddev_plan_time from pg_stat_monitor; query | calls | total_plan_time | min_plan_time | max_plan_time | mean_plan_time | stddev_plan_time ---------------------------------------------------------------------------------------------------------------------------+-------+-----------------+---------------+---------------+----------------+------------------ - SELECT * from pg_stat_monitor_settings | 2 | 0.2275 | 0.1088 | 0.1187 | 0.1138 | 0.0049 + SELECT * from pg_stat_monitor_settings | 2 | 0.2432 | 0.1214 | 0.1219 | 0.1216 | 0.0002 SELECT pg_stat_monitor_reset() | 1 | 0 | 0 | 0 | 0 | 0 - SELECT query, calls, total_plan_time, min_plan_time, max_plan_time, mean_plan_time, stddev_plan_time from pg_stat_monitor | 1 | 1.0944 | 1.0944 | 1.0944 | 1.0944 | 0 + SELECT query, calls, total_plan_time, min_plan_time, max_plan_time, mean_plan_time, stddev_plan_time from pg_stat_monitor | 1 | 1.4538 | 1.4538 | 1.4538 | 1.4538 | 0 (3 rows) SELECT pg_stat_monitor_reset(); @@ -65,7 +65,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -85,7 +85,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -113,12 +113,12 @@ select substr(query, 0,100) as query, calls, total_plan_time, min_plan_time,max_ SELECT * from pg_stat_monitor_settings | 2 | 0 | 0 | 0 | 0 | 0 SELECT pg_stat_monitor_reset() | 1 | 0 | 0 | 0 | 0 | 0 SELECT query, calls, total_plan_time, min_plan_time, max_plan_time, mean_plan_time, stddev_plan_tim | 1 | 0 | 0 | 0 | 0 | 0 - select (max_plan_time = $1) from pg_stat_monitor where calls = $2 | 1 | 0 | 0 | 0 | 0 | 0 - select (mean_plan_time = $1) from pg_stat_monitor where calls = $2 | 1 | 0 | 0 | 0 | 0 | 0 - select (min_plan_time = $1) from pg_stat_monitor where calls = $2 | 1 | 0 | 0 | 0 | 0 | 0 - select (stddev_plan_time = $1) from pg_stat_monitor where calls = $2 | 1 | 0 | 0 | 0 | 0 | 0 - select (total_plan_time = $1) from pg_stat_monitor where calls = $2 | 1 | 0 | 0 | 0 | 0 | 0 - select substr(query, $1,$2) as query, calls, total_plan_time, min_plan_time,max_plan_time,mean_plan | 1 | 0 | 0 | 0 | 0 | 0 + select (max_plan_time = 0) from pg_stat_monitor where calls = 2 | 1 | 0 | 0 | 0 | 0 | 0 + select (mean_plan_time = 0) from pg_stat_monitor where calls = 2 | 1 | 0 | 0 | 0 | 0 | 0 + select (min_plan_time = 0) from pg_stat_monitor where calls = 2 | 1 | 0 | 0 | 0 | 0 | 0 + select (stddev_plan_time = 0) from pg_stat_monitor where calls = 2 | 1 | 0 | 0 | 0 | 0 | 0 + select (total_plan_time = 0) from pg_stat_monitor where calls = 2 | 1 | 0 | 0 | 0 | 0 | 0 + select substr(query, 0,100) as query, calls, total_plan_time, min_plan_time,max_plan_time,mean_plan | 1 | 0 | 0 | 0 | 0 | 0 (9 rows) SELECT pg_stat_monitor_reset(); diff --git a/t/expected/003_settings_pgms_extract_comments.out b/t/expected/003_settings_pgms_extract_comments.out index 29f4c24..dfb7491 100644 --- a/t/expected/003_settings_pgms_extract_comments.out +++ b/t/expected/003_settings_pgms_extract_comments.out @@ -11,7 +11,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -32,12 +32,12 @@ SELECT 1 AS num /* First comment */, 'John' as Name /* Second comment*/; (1 row) SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C"; - query | comments -------------------------------------------------------------------------+------------------------------------------ - SELECT $1 AS num /* First comment */, $2 as Name /* Second comment*/ | /* First comment */, /* Second comment*/ - SELECT * from pg_stat_monitor_settings | - SELECT pg_stat_monitor_reset() | - SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C" | + query | comments +-------------------------------------------------------------------------+------------------------------------------ + SELECT * from pg_stat_monitor_settings | + SELECT 1 AS num /* First comment */, 'John' as Name /* Second comment*/ | /* First comment */, /* Second comment*/ + SELECT pg_stat_monitor_reset() | + SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C" | (4 rows) SELECT pg_stat_monitor_reset(); @@ -52,7 +52,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -73,12 +73,12 @@ SELECT 1 AS num /* First comment */, 'John' as Name /* Second comment*/; (1 row) SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C"; - query | comments -------------------------------------------------------------------------+------------------------------------------ - SELECT $1 AS num /* First comment */, $2 as Name /* Second comment*/ | /* First comment */, /* Second comment*/ - SELECT * from pg_stat_monitor_settings | - SELECT pg_stat_monitor_reset() | - SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C" | + query | comments +-------------------------------------------------------------------------+------------------------------------------ + SELECT * from pg_stat_monitor_settings | + SELECT 1 AS num /* First comment */, 'John' as Name /* Second comment*/ | /* First comment */, /* Second comment*/ + SELECT pg_stat_monitor_reset() | + SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C" | (4 rows) Drop extension pg_stat_monitor; diff --git a/t/expected/004_settings_pgsm_track.out b/t/expected/004_settings_pgsm_track.out index 99353c1..d3174d4 100644 --- a/t/expected/004_settings_pgsm_track.out +++ b/t/expected/004_settings_pgsm_track.out @@ -11,7 +11,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -37,7 +37,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -63,7 +63,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes diff --git a/t/expected/005_settings_pgsm_enable_query_plan.out b/t/expected/005_settings_pgsm_enable_query_plan.out index ea6f7df..f0f8c10 100644 --- a/t/expected/005_settings_pgsm_enable_query_plan.out +++ b/t/expected/005_settings_pgsm_enable_query_plan.out @@ -11,7 +11,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -44,11 +44,11 @@ select substr(query, 0,50) as query, calls, query_plan from pg_stat_monitor orde query | calls | query_plan ---------------------------------------------------+-------+------------------------------------------- CREATE TABLE TBL_0(key text primary key, txt_0 te | 1 | - INSERT INTO TBL_0(key, txt_0, value_0) VALUES($1, | 1 | + INSERT INTO TBL_0(key, txt_0, value_0) VALUES('00 | 1 | SELECT * from pg_stat_monitor_settings | 1 | Function Scan on pg_stat_monitor_settings SELECT key, txt_0, value_0 FROM TBL_0 | 2 | Seq Scan on tbl_0 SELECT pg_stat_monitor_reset() | 1 | Result - UPDATE TBL_0 SET value_0 = $1 | 1 | + UPDATE TBL_0 SET value_0 = 1681692777 | 1 | (6 rows) Drop TABLE TBL_0; @@ -64,7 +64,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -97,12 +97,12 @@ select substr(query, 0,50) as query, calls, query_plan from pg_stat_monitor orde query | calls | query_plan ---------------------------------------------------+-------+------------ CREATE TABLE TBL_0(key text primary key, txt_0 te | 1 | - INSERT INTO TBL_0(key, txt_0, value_0) VALUES($1, | 1 | + INSERT INTO TBL_0(key, txt_0, value_0) VALUES('00 | 1 | SELECT * from pg_stat_monitor_settings | 1 | SELECT key, txt_0, value_0 FROM TBL_0 | 2 | SELECT pg_stat_monitor_reset() | 1 | - UPDATE TBL_0 SET value_0 = $1 | 1 | - select substr(query, $1,$2) as query, calls, quer | 1 | + UPDATE TBL_0 SET value_0 = 1681692777 | 1 | + select substr(query, 0,50) as query, calls, query | 1 | (7 rows) Drop extension pg_stat_monitor; diff --git a/t/expected/006_settings_pgsm_overflow_target.out b/t/expected/006_settings_pgsm_overflow_target.out index 9d5edbe..72ff70a 100644 --- a/t/expected/006_settings_pgsm_overflow_target.out +++ b/t/expected/006_settings_pgsm_overflow_target.out @@ -11,7 +11,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -37,7 +37,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes diff --git a/t/expected/007_settings_pgsm_query_shared_buffer.out b/t/expected/007_settings_pgsm_query_shared_buffer.out index 426e6c8..2881a1e 100644 --- a/t/expected/007_settings_pgsm_query_shared_buffer.out +++ b/t/expected/007_settings_pgsm_query_shared_buffer.out @@ -11,7 +11,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -31,11 +31,11 @@ select datname, substr(query,0,100) as query, calls from pg_stat_monitor order b ---------+-----------------------------------------------------------------------------------------------------+------- example | BEGIN | 10000 example | END | 10000 - example | INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES ($1, $2, $3, $4, CURRENT_TIMESTAMP | 10000 - example | SELECT abalance FROM pgbench_accounts WHERE aid = $1 | 10000 - example | UPDATE pgbench_accounts SET abalance = abalance + $1 WHERE aid = $2 | 10000 - example | UPDATE pgbench_branches SET bbalance = bbalance + $1 WHERE bid = $2 | 10000 - example | UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2 | 10000 + example | INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (21, 5, 983612, -3378, CURRENT_TIM | 10000 + example | SELECT abalance FROM pgbench_accounts WHERE aid = 590644 | 10000 + example | UPDATE pgbench_accounts SET abalance = abalance + -3378 WHERE aid = 983612 | 10000 + example | UPDATE pgbench_branches SET bbalance = bbalance + -3038 WHERE bid = 3 | 10000 + example | UPDATE pgbench_tellers SET tbalance = tbalance + -4835 WHERE tid = 68 | 10000 example | alter table pgbench_accounts add primary key (aid) | 1 example | alter table pgbench_branches add primary key (bid) | 1 example | alter table pgbench_tellers add primary key (tid) | 1 @@ -47,8 +47,8 @@ select datname, substr(query,0,100) as query, calls from pg_stat_monitor order b example | create table pgbench_history(tid int,bid int,aid int,delta int,mtime timestamp,filler char(22)) | 1 example | create table pgbench_tellers(tid int not null,bid int,tbalance int,filler char(84)) with (fillfacto | 1 example | drop table if exists pgbench_accounts, pgbench_branches, pgbench_history, pgbench_tellers | 1 - example | insert into pgbench_branches(bid,bbalance) values($1,$2) | 10 - example | insert into pgbench_tellers(tid,bid,tbalance) values ($1,$2,$3) | 100 + example | insert into pgbench_branches(bid,bbalance) values(1,0) | 10 + example | insert into pgbench_tellers(tid,bid,tbalance) values (1,1,0) | 100 (20 rows) SELECT pg_stat_monitor_reset(); @@ -63,7 +63,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -89,7 +89,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes diff --git a/t/expected/008_settings_pgsm_histogram_buckets.out b/t/expected/008_settings_pgsm_histogram_buckets.out index b8c70db..2a95352 100644 --- a/t/expected/008_settings_pgsm_histogram_buckets.out +++ b/t/expected/008_settings_pgsm_histogram_buckets.out @@ -11,7 +11,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -37,7 +37,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -63,7 +63,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -89,7 +89,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -115,7 +115,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes diff --git a/t/expected/009_settings_pgsm_histogram_max.out b/t/expected/009_settings_pgsm_histogram_max.out index 2a92198..8b38217 100644 --- a/t/expected/009_settings_pgsm_histogram_max.out +++ b/t/expected/009_settings_pgsm_histogram_max.out @@ -11,7 +11,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -37,7 +37,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -63,7 +63,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -89,7 +89,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes diff --git a/t/expected/010_settings_pgsm_histogram_min.out b/t/expected/010_settings_pgsm_histogram_min.out index 6d64979..73b51a5 100644 --- a/t/expected/010_settings_pgsm_histogram_min.out +++ b/t/expected/010_settings_pgsm_histogram_min.out @@ -11,7 +11,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 1 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -37,7 +37,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 1000 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -63,7 +63,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 10000 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -89,7 +89,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 99999 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes diff --git a/t/expected/011_settings_pgsm_bucket_time.out b/t/expected/011_settings_pgsm_bucket_time.out index 6b9afff..f9a4150 100644 --- a/t/expected/011_settings_pgsm_bucket_time.out +++ b/t/expected/011_settings_pgsm_bucket_time.out @@ -11,7 +11,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 10000 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -37,7 +37,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 1000 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -63,7 +63,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 100 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -89,7 +89,7 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no + pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes @@ -103,56 +103,3 @@ SELECT * from pg_stat_monitor_settings; pg_stat_monitor.pgsm_track_planning | no | no | Selects whether planning statistics are tracked. | | | yes, no | no (15 rows) -SELECT pg_stat_monitor_reset(); - pg_stat_monitor_reset ------------------------ - -(1 row) - -SELECT * from pg_stat_monitor_settings; - name | value | default_value | description | minimum | maximum | options | restart -------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+--------- - pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes - pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes - pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no - pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes - pg_stat_monitor.pgsm_bucket_time | 1 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes - pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes - pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes - pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no - pg_stat_monitor.pgsm_track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no - pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no - pg_stat_monitor.pgsm_track_planning | no | no | Selects whether planning statistics are tracked. | | | yes, no | no -(15 rows) - -SELECT pg_stat_monitor_reset(); - pg_stat_monitor_reset ------------------------ - -(1 row) - -SELECT * from pg_stat_monitor_settings; - name | value | default_value | description | minimum | maximum | options | restart -------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+--------- - pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes - pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes - pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no - pg_stat_monitor.pgsm_normalized_query | yes | yes | Selects whether save query in normalized format. | | | yes, no | no - pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes - pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes - pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes - pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes - pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes - pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no - pg_stat_monitor.pgsm_track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no - pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no - pg_stat_monitor.pgsm_track_planning | no | no | Selects whether planning statistics are tracked. | | | yes, no | no -(15 rows) - -Drop extension pg_stat_monitor; diff --git a/t/expected/017_execution_stats.out b/t/expected/017_execution_stats.out index 6f2eb7a..c41e4fc 100644 --- a/t/expected/017_execution_stats.out +++ b/t/expected/017_execution_stats.out @@ -48,9 +48,9 @@ SELECT * from pg_stat_monitor_settings; SELECT query, calls, total_exec_time, min_exec_time, max_exec_time, mean_exec_time, stddev_exec_time from pg_stat_monitor; query | calls | total_exec_time | min_exec_time | max_exec_time | mean_exec_time | stddev_exec_time ---------------------------------------------------------------------------------------------------------------------------+-------+-----------------+---------------+---------------+----------------+------------------ - SELECT * from pg_stat_monitor_settings | 2 | 0.0736 | 0.0341 | 0.0396 | 0.0368 | 0.0028 SELECT query, calls, total_exec_time, min_exec_time, max_exec_time, mean_exec_time, stddev_exec_time from pg_stat_monitor | 1 | 0 | 0 | 0 | 0 | 0 - SELECT pg_stat_monitor_reset() | 1 | 0.03 | 0.03 | 0.03 | 0.03 | 0 + SELECT pg_stat_monitor_reset() | 1 | 0.0302 | 0.0302 | 0.0302 | 0.0302 | 0 + SELECT * from pg_stat_monitor_settings | 2 | 0.069 | 0.0342 | 0.0349 | 0.0345 | 0.0004 (3 rows) SELECT pg_stat_monitor_reset(); From 3d649311922dab9893f5a5f9bbb2c0e10666d0d2 Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Thu, 9 Jun 2022 16:48:18 +0530 Subject: [PATCH 24/28] PMM-9951 run the workflow on push temp (#258) --- .github/workflows/postgresql-11-pmm.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/postgresql-11-pmm.yaml b/.github/workflows/postgresql-11-pmm.yaml index ca03432..15165a7 100644 --- a/.github/workflows/postgresql-11-pmm.yaml +++ b/.github/workflows/postgresql-11-pmm.yaml @@ -1,5 +1,5 @@ name: postgresql-11-pmm-integration -on: pull_request +on: push jobs: build: @@ -18,7 +18,7 @@ jobs: run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=11 --pgstat-monitor-branch=${{ github.head_ref }} --pgstat-monitor-repo=${{ github.actor }}/pg_stat_monitor + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=11 --pgstat-monitor-branch=${{ github.head_ref }} - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed From ced7aef0e4f2e8aa1545f2795fd53847eea34881 Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Thu, 9 Jun 2022 18:23:50 +0530 Subject: [PATCH 25/28] PMM-9951 moving integration tests to push --- .github/workflows/postgresql-11-pmm.yaml | 2 +- .github/workflows/postgresql-12-pmm.yaml | 4 ++-- .github/workflows/postgresql-13-pmm.yaml | 4 ++-- .github/workflows/postgresql-14-pmm.yaml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/postgresql-11-pmm.yaml b/.github/workflows/postgresql-11-pmm.yaml index 15165a7..c845b32 100644 --- a/.github/workflows/postgresql-11-pmm.yaml +++ b/.github/workflows/postgresql-11-pmm.yaml @@ -18,7 +18,7 @@ jobs: run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=11 --pgstat-monitor-branch=${{ github.head_ref }} + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=11 - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed diff --git a/.github/workflows/postgresql-12-pmm.yaml b/.github/workflows/postgresql-12-pmm.yaml index e5a1881..d80541a 100644 --- a/.github/workflows/postgresql-12-pmm.yaml +++ b/.github/workflows/postgresql-12-pmm.yaml @@ -1,5 +1,5 @@ name: postgresql-12-pmm-integration -on: pull_request +on: push jobs: build: @@ -18,7 +18,7 @@ jobs: run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=12 --pgstat-monitor-branch=${{ github.head_ref }} --pgstat-monitor-repo=${{ github.actor }}/pg_stat_monitor + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=12 - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed diff --git a/.github/workflows/postgresql-13-pmm.yaml b/.github/workflows/postgresql-13-pmm.yaml index 1ffbea7..5879250 100644 --- a/.github/workflows/postgresql-13-pmm.yaml +++ b/.github/workflows/postgresql-13-pmm.yaml @@ -1,5 +1,5 @@ name: postgresql-13-pmm-integration -on: pull_request +on: push jobs: build: @@ -18,7 +18,7 @@ jobs: run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=13 --pgstat-monitor-branch=${{ github.head_ref }} --pgstat-monitor-repo=${{ github.actor }}/pg_stat_monitor + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=13 - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed diff --git a/.github/workflows/postgresql-14-pmm.yaml b/.github/workflows/postgresql-14-pmm.yaml index ca70e94..6c97c72 100644 --- a/.github/workflows/postgresql-14-pmm.yaml +++ b/.github/workflows/postgresql-14-pmm.yaml @@ -1,5 +1,5 @@ name: postgresql-14-pmm-integration -on: pull_request +on: push jobs: build: @@ -18,7 +18,7 @@ jobs: run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=14 --pgstat-monitor-branch=${{ github.head_ref }} --pgstat-monitor-repo=${{ github.actor }}/pg_stat_monitor + run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=14 - name: Get PMM-Agent Logs from the Container if: success() || failure() # run this step even if previous step failed From 05df7f0e8e9cb46267eb9256746e8ddf9f176132 Mon Sep 17 00:00:00 2001 From: Anastasia Alexadrova Date: Mon, 13 Jun 2022 18:03:55 +0300 Subject: [PATCH 26/28] PG-370 Release notes PGSM 1.0.0-rc1 --- docs/RELEASE_NOTES.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 301b35d..53efcda 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -56,6 +56,33 @@ Bump version from 1.0.0-rc.2 to 1.0.0. [PG-369](https://jira.percona.com/browse/PG-358): Fixed issue with incorrect `wal_bytes` values for PostgreSQL 11 and 12 that caused Query Analytics failure in PMM by ignoring the `WalUsage` variable value for these versions. +## 1.0.0-rc.1 + +### Improvements + +[PG-165](https://jira.percona.com/browse/PG-165): Recycle expired buckets + +[PG-167](https://jira.percona.com/browse/PG-167): Make SQL error codes readable by updating their data types + +[PG-193](https://jira.percona.com/browse/PG-193): Create a comment based tags to identify different parameters + +[PG-199](https://jira.percona.com/browse/PG-199): Documentation: Add the integration with PMM section in User Guide + +[PG-210](https://jira.percona.com/browse/PG-210): Documentation: Update column names per POstgreSQL version to match the upstream ones + +### Bugs Fixed + +[PG-177](https://jira.percona.com/browse/PG-177): Fixed the error in histogram ranges + +[PG-214](https://jira.percona.com/browse/PG-214): Fixed the issue with the display of the error message as part of the query column in `pg_stat_monitor` view + +[PG-246](https://jira.percona.com/browse/PG-246): Fixed the issue with significant CPU and memory resource usage when `pg_stat_monitor.pgsm_enable_query_plan` parameter is enabled + +[PG-262](https://jira.percona.com/browse/PG-262): Fixed the way the comments are extracted in pg_stat_monitor view + +[PG-271](https://jira.percona.com/browse/PG-271): Fixed the issue with enabling the ``pg_stat_monitor.pgsm_overflow_target`` configuration parameter. + +[PG-272](https://jira.percona.com/browse/PG-272): Fixed the server crash when calling the `pg_stat_monitor_reset()` function by using the correct `PGSM_MAX_BUCKETS` GUC as the limit to the loop ## REL0_9_0_STABLE From 1ff4891191bc408c09435d69dbf03486081b9309 Mon Sep 17 00:00:00 2001 From: Ibrar Ahmed Date: Tue, 14 Jun 2022 18:04:43 +0500 Subject: [PATCH 27/28] PG-439: Remove warning of comparison of unsigned enum expression. (#257) --- pg_stat_monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pg_stat_monitor.c b/pg_stat_monitor.c index 9f3c5e3..41e5fe5 100644 --- a/pg_stat_monitor.c +++ b/pg_stat_monitor.c @@ -1938,7 +1938,7 @@ pg_stat_monitor_internal(FunctionCallInfo fcinfo, nulls[i++] = true; /* cmd_type at column number 11 */ - if (tmp.info.cmd_type < 0) + if (tmp.info.cmd_type == CMD_NOTHING) nulls[i++] = true; else values[i++] = Int64GetDatumFast(tmp.info.cmd_type); From 1f9b1feff62e3226db9c095a22b50e7eee9857be Mon Sep 17 00:00:00 2001 From: Ibrar Ahmed Date: Fri, 17 Jun 2022 16:32:55 +0500 Subject: [PATCH 28/28] PG-300: Fix potential duplicate queryid issue. (#262) There is some potential problem where there is a chance that we got a duplicate queryid. This patch will eliminate that problem. --- pg_stat_monitor.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/pg_stat_monitor.c b/pg_stat_monitor.c index 41e5fe5..9a29e99 100644 --- a/pg_stat_monitor.c +++ b/pg_stat_monitor.c @@ -181,7 +181,7 @@ static void pg_stat_monitor_internal(FunctionCallInfo fcinfo, static void AppendJumble(JumbleState *jstate, const unsigned char *item, Size size); static void JumbleQuery(JumbleState *jstate, Query *query); -static void JumbleRangeTable(JumbleState *jstate, List *rtable); +static void JumbleRangeTable(JumbleState *jstate, List *rtable, CmdType cmd_type); static void JumbleExpr(JumbleState *jstate, Node *node); static void RecordConstLocation(JumbleState *jstate, int location); /* @@ -2233,9 +2233,19 @@ JumbleQuery(JumbleState *jstate, Query *query) APP_JUMB(query->commandType); /* resultRelation is usually predictable from commandType */ JumbleExpr(jstate, (Node *) query->cteList); - JumbleRangeTable(jstate, query->rtable); - JumbleExpr(jstate, (Node *) query->jointree); - JumbleExpr(jstate, (Node *) query->targetList); + + JumbleRangeTable(jstate, query->rtable, query->commandType); + + /* + * Skip jointree and targetlist in case of insert statment + * to avoid queryid duplication problem. + */ + if (query->commandType != CMD_INSERT) + { + JumbleExpr(jstate, (Node *) query->jointree); + JumbleExpr(jstate, (Node *) query->targetList); + } + JumbleExpr(jstate, (Node *) query->onConflict); JumbleExpr(jstate, (Node *) query->returningList); JumbleExpr(jstate, (Node *) query->groupClause); @@ -2254,7 +2264,7 @@ JumbleQuery(JumbleState *jstate, Query *query) * Jumble a range table */ static void -JumbleRangeTable(JumbleState *jstate, List *rtable) +JumbleRangeTable(JumbleState *jstate, List *rtable, CmdType cmd_type) { ListCell *lc = NULL; @@ -2262,6 +2272,9 @@ JumbleRangeTable(JumbleState *jstate, List *rtable) { RangeTblEntry *rte = lfirst_node(RangeTblEntry, lc); + if (rte->rtekind != RTE_RELATION && cmd_type == CMD_INSERT) + continue; + APP_JUMB(rte->rtekind); switch (rte->rtekind) {