-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #311 from EngineeredVirus/main
Merging changes back to the main branch after the 1.1.1 release
- Loading branch information
Showing
44 changed files
with
1,199 additions
and
1,829 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: postgresql-15-pmm-integration | ||
on: push | ||
|
||
jobs: | ||
build: | ||
name: pg-15-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 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=15 --pgstat-monitor-branch=REL_1_1_1 | ||
|
||
- name: Get PMM-Agent Logs from the Container | ||
if: success() || failure() # run this step even if previous step failed | ||
run: docker exec pgsql_pgsm_15 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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
CREATE OR REPLACE FUNCTION generate_histogram() | ||
RETURNS TABLE ( | ||
range TEXT, freq INT, bar TEXT | ||
) AS $$ | ||
Declare | ||
bucket_id integer; | ||
query_id text; | ||
BEGIN | ||
select bucket into bucket_id from pg_stat_monitor order by calls desc limit 1; | ||
select queryid into query_id from pg_stat_monitor order by calls desc limit 1; | ||
--RAISE INFO 'bucket_id %', bucket_id; | ||
--RAISE INFO 'query_id %', query_id; | ||
return query | ||
SELECT * FROM histogram(bucket_id, query_id) AS a(range TEXT, freq INT, bar TEXT); | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
CREATE OR REPLACE FUNCTION run_pg_sleep(INTEGER) RETURNS VOID AS $$ | ||
DECLARE | ||
loops ALIAS FOR $1; | ||
BEGIN | ||
FOR i IN 1..loops LOOP | ||
--RAISE INFO 'Current timestamp: %', timeofday()::TIMESTAMP; | ||
RAISE INFO 'Sleep % seconds', i; | ||
PERFORM pg_sleep(i); | ||
END LOOP; | ||
END; | ||
$$ LANGUAGE 'plpgsql' STRICT; | ||
CREATE EXTENSION pg_stat_monitor; | ||
SELECT pg_stat_monitor_reset(); | ||
pg_stat_monitor_reset | ||
----------------------- | ||
|
||
(1 row) | ||
|
||
Set pg_stat_monitor.pgsm_track='all'; | ||
select run_pg_sleep(5); | ||
INFO: Sleep 1 seconds | ||
INFO: Sleep 2 seconds | ||
INFO: Sleep 3 seconds | ||
INFO: Sleep 4 seconds | ||
INFO: Sleep 5 seconds | ||
run_pg_sleep | ||
-------------- | ||
|
||
(1 row) | ||
|
||
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) | 3 | {0,0,0,0,0,0,3,0,0,0} | ||
SELECT pg_sleep(i) | 2 | {0,0,0,0,0,0,0,2,0,0} | ||
SELECT pg_stat_monitor_reset() | 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(5) | 1 | {0,0,0,0,0,0,0,0,1,0} | ||
(6 rows) | ||
|
||
select * from generate_histogram(); | ||
range | freq | bar | ||
--------------------+------+-------------------------------------------------------------------------------------------- | ||
(0 - 3)} | 0 | | ||
(3 - 10)} | 0 | | ||
(10 - 31)} | 0 | | ||
(31 - 100)} | 0 | | ||
(100 - 316)} | 0 | | ||
(316 - 1000)} | 0 | | ||
(1000 - 3162)} | 3 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | ||
(3162 - 10000)} | 0 | | ||
(10000 - 31622)} | 0 | | ||
(31622 - 100000)} | 0 | | ||
(10 rows) | ||
|
||
DROP EXTENSION pg_stat_monitor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
CREATE OR REPLACE FUNCTION generate_histogram() | ||
RETURNS TABLE ( | ||
range TEXT, freq INT, bar TEXT | ||
) AS $$ | ||
Declare | ||
bucket_id integer; | ||
query_id text; | ||
BEGIN | ||
select bucket into bucket_id from pg_stat_monitor order by calls desc limit 1; | ||
select queryid into query_id from pg_stat_monitor order by calls desc limit 1; | ||
--RAISE INFO 'bucket_id %', bucket_id; | ||
--RAISE INFO 'query_id %', query_id; | ||
return query | ||
SELECT * FROM histogram(bucket_id, query_id) AS a(range TEXT, freq INT, bar TEXT); | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
CREATE OR REPLACE FUNCTION run_pg_sleep(INTEGER) RETURNS VOID AS $$ | ||
DECLARE | ||
loops ALIAS FOR $1; | ||
BEGIN | ||
FOR i IN 1..loops LOOP | ||
--RAISE INFO 'Current timestamp: %', timeofday()::TIMESTAMP; | ||
RAISE INFO 'Sleep % seconds', i; | ||
PERFORM pg_sleep(i); | ||
END LOOP; | ||
END; | ||
$$ LANGUAGE 'plpgsql' STRICT; | ||
CREATE EXTENSION pg_stat_monitor; | ||
SELECT pg_stat_monitor_reset(); | ||
pg_stat_monitor_reset | ||
----------------------- | ||
|
||
(1 row) | ||
|
||
Set pg_stat_monitor.pgsm_track='all'; | ||
select run_pg_sleep(5); | ||
INFO: Sleep 1 seconds | ||
INFO: Sleep 2 seconds | ||
INFO: Sleep 3 seconds | ||
INFO: Sleep 4 seconds | ||
INFO: Sleep 5 seconds | ||
run_pg_sleep | ||
-------------- | ||
|
||
(1 row) | ||
|
||
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) | 3 | {0,0,0,0,0,0,3,0,0,0} | ||
SELECT pg_sleep(i) | 2 | {0,0,0,0,0,0,0,2,0,0} | ||
SELECT pg_stat_monitor_reset() | 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(5) | 1 | {0,0,0,0,0,0,0,0,1,0} | ||
(6 rows) | ||
|
||
select * from generate_histogram(); | ||
range | freq | bar | ||
--------------------+------+-------------------------------- | ||
(0 - 3)} | 0 | | ||
(3 - 10)} | 0 | | ||
(10 - 31)} | 0 | | ||
(31 - 100)} | 0 | | ||
(100 - 316)} | 0 | | ||
(316 - 1000)} | 0 | | ||
(1000 - 3162)} | 3 | ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | ||
(3162 - 10000)} | 0 | | ||
(10000 - 31622)} | 0 | | ||
(31622 - 100000)} | 0 | | ||
(10 rows) | ||
|
||
DROP EXTENSION pg_stat_monitor; |
Oops, something went wrong.