mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 05:56:21 +00:00
PG-562: Histogram Ranges/Buckets are not correct.
Added buckets for queries that take less than minimum histogram time and one for the ones taking more than the max value specified. Also, in case the buckets end up overlapping, on server start, an error will be thrown informing the user of this issue and requesting a rectification. Refactored the code to consolidate the calculations in a single function.
This commit is contained in:
committed by
Muhammad Usama
parent
1286427445
commit
209f370cef
@@ -20,19 +20,7 @@ SELECT pg_stat_monitor_reset();
|
||||
SELECT name, setting, unit, context, vartype, source, min_val, max_val, enumvals, boot_val, reset_val, pending_restart FROM pg_settings WHERE name='pg_stat_monitor.pgsm_histogram_max';
|
||||
name | setting | unit | context | vartype | source | min_val | max_val | enumvals | boot_val | reset_val | pending_restart
|
||||
------------------------------------+---------+------+------------+---------+--------------------+---------+------------+----------+----------+-----------+-----------------
|
||||
pg_stat_monitor.pgsm_histogram_max | 10 | | postmaster | integer | configuration file | 10 | 2147483647 | | 100000 | 10 | f
|
||||
(1 row)
|
||||
|
||||
SELECT pg_stat_monitor_reset();
|
||||
pg_stat_monitor_reset
|
||||
-----------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT name, setting, unit, context, vartype, source, min_val, max_val, enumvals, boot_val, reset_val, pending_restart FROM pg_settings WHERE name='pg_stat_monitor.pgsm_histogram_max';
|
||||
name | setting | unit | context | vartype | source | min_val | max_val | enumvals | boot_val | reset_val | pending_restart
|
||||
------------------------------------+---------+------+------------+---------+--------------------+---------+------------+----------+----------+-----------+-----------------
|
||||
pg_stat_monitor.pgsm_histogram_max | 100 | | postmaster | integer | configuration file | 10 | 2147483647 | | 100000 | 100 | f
|
||||
pg_stat_monitor.pgsm_histogram_max | 50 | | postmaster | integer | configuration file | 10 | 2147483647 | | 100000 | 50 | f
|
||||
(1 row)
|
||||
|
||||
SELECT pg_stat_monitor_reset();
|
||||
|
||||
@@ -20,7 +20,7 @@ SELECT pg_stat_monitor_reset();
|
||||
SELECT name, setting, unit, context, vartype, source, min_val, max_val, enumvals, boot_val, reset_val, pending_restart FROM pg_settings WHERE name='pg_stat_monitor.pgsm_histogram_min';
|
||||
name | setting | unit | context | vartype | source | min_val | max_val | enumvals | boot_val | reset_val | pending_restart
|
||||
------------------------------------+---------+------+------------+---------+--------------------+---------+------------+----------+----------+-----------+-----------------
|
||||
pg_stat_monitor.pgsm_histogram_min | 1000 | | postmaster | integer | configuration file | 0 | 2147483647 | | 1 | 1000 | f
|
||||
pg_stat_monitor.pgsm_histogram_min | 20 | | postmaster | integer | configuration file | 0 | 2147483647 | | 1 | 20 | f
|
||||
(1 row)
|
||||
|
||||
SELECT pg_stat_monitor_reset();
|
||||
@@ -32,19 +32,7 @@ SELECT pg_stat_monitor_reset();
|
||||
SELECT name, setting, unit, context, vartype, source, min_val, max_val, enumvals, boot_val, reset_val, pending_restart FROM pg_settings WHERE name='pg_stat_monitor.pgsm_histogram_min';
|
||||
name | setting | unit | context | vartype | source | min_val | max_val | enumvals | boot_val | reset_val | pending_restart
|
||||
------------------------------------+---------+------+------------+---------+--------------------+---------+------------+----------+----------+-----------+-----------------
|
||||
pg_stat_monitor.pgsm_histogram_min | 10000 | | postmaster | integer | configuration file | 0 | 2147483647 | | 1 | 10000 | f
|
||||
(1 row)
|
||||
|
||||
SELECT pg_stat_monitor_reset();
|
||||
pg_stat_monitor_reset
|
||||
-----------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT name, setting, unit, context, vartype, source, min_val, max_val, enumvals, boot_val, reset_val, pending_restart FROM pg_settings WHERE name='pg_stat_monitor.pgsm_histogram_min';
|
||||
name | setting | unit | context | vartype | source | min_val | max_val | enumvals | boot_val | reset_val | pending_restart
|
||||
------------------------------------+---------+------+------------+---------+--------------------+---------+------------+----------+----------+-----------+-----------------
|
||||
pg_stat_monitor.pgsm_histogram_min | 99999 | | postmaster | integer | configuration file | 0 | 2147483647 | | 1 | 99999 | f
|
||||
pg_stat_monitor.pgsm_histogram_min | 100 | | postmaster | integer | configuration file | 0 | 2147483647 | | 1 | 100 | f
|
||||
(1 row)
|
||||
|
||||
DROP EXTENSION pg_stat_monitor;
|
||||
|
||||
Reference in New Issue
Block a user