PG-606: New GUC required for enabling/disabling of pgsm_query_id calculation… (#383)

* PG-606: New GUC required for enabling/disabling of pgsm_query_id calculation

Adds a new GUC pg_stat_monitor.pgsm_enable_pgsm_query_id to enable/disable
pgsm query id calculation. Apart from that patch also refactors the GUC-related
code to match PostgreSQL conventions.

Moreover, the commit also changes the pgsm_enable_overflow GUC to boolean
instead of enum.
This commit is contained in:
Muhammad Usama
2023-02-23 19:08:09 +05:00
committed by GitHub
parent ce32f6f15d
commit 05ffcac2fa
16 changed files with 458 additions and 459 deletions

View File

@@ -19,7 +19,7 @@ my $pgdata = $node->data_dir;
# UPDATE postgresql.conf to include/load pg_stat_monitor library
open my $conf, '>>', "$pgdata/postgresql.conf";
print $conf "shared_preload_libraries = 'pg_stat_monitor'\n";
print $conf "pg_stat_monitor.pgsm_overflow_target = 0\n";
print $conf "pg_stat_monitor.pgsm_enable_overflow = false\n";
print $conf "pg_stat_monitor.pgsm_bucket_time = 1\n";
print $conf "pg_stat_monitor.pgsm_max_buckets = 2\n";
print $conf "pg_stat_monitor.pgsm_max = 1\n";
@@ -61,7 +61,7 @@ PGSM::append_to_file($stdout);
ok($cmdret == 0, "SELECT count(queryid) FROM pg_stat_monitor");
PGSM::append_to_file($stdout);
$node->append_conf('postgresql.conf', "pg_stat_monitor.pgsm_overflow_target = 1\n");
$node->append_conf('postgresql.conf', "pg_stat_monitor.pgsm_enable_overflow = true\n");
$node->restart();
($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT pg_stat_monitor_reset();', extra_params => ['-a', '-Pformat=aligned','-Ptuples_only=off']);