mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 14:06:20 +00:00
PG-267 Add testcase to test histogram.
This commit adds following three sql based testcases: 1) Test unique application name set by user. 2) Histogram function is working properly as desired. 3) Error on insert is shown with proper message.
This commit is contained in:
committed by
Hamid Akhtar
parent
0573be4090
commit
5aa6764041
38
regression/expected/application_name_unique.out
Normal file
38
regression/expected/application_name_unique.out
Normal file
@@ -0,0 +1,38 @@
|
||||
Create EXTENSION pg_stat_monitor;
|
||||
SELECT pg_stat_monitor_reset();
|
||||
pg_stat_monitor_reset
|
||||
-----------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
Set application_name = 'naeem' ;
|
||||
SELECT 1 AS num;
|
||||
num
|
||||
-----
|
||||
1
|
||||
(1 row)
|
||||
|
||||
Set application_name = 'psql' ;
|
||||
SELECT 1 AS num;
|
||||
num
|
||||
-----
|
||||
1
|
||||
(1 row)
|
||||
|
||||
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 pg_stat_monitor_reset() | pg_regress/application_name_unique
|
||||
Set application_name = 'naeem' | naeem
|
||||
Set application_name = 'psql' | psql
|
||||
(5 rows)
|
||||
|
||||
SELECT pg_stat_monitor_reset();
|
||||
pg_stat_monitor_reset
|
||||
-----------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
DROP EXTENSION pg_stat_monitor;
|
||||
Reference in New Issue
Block a user