Last active
April 19, 2020 08:40
-
-
Save digi0ps/8d1d336579bee74c4cfe7b5c834f006b to your computer and use it in GitHub Desktop.
Postgres testing with an active connection
This file contains hidden or 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
#! /bin/zsh | |
zmodload zsh/datetime | |
start=$EPOCHREALTIME | |
PGPASSWORD=password psql -U localadmin testing \ | |
-c "DO | |
\$do\$ | |
BEGIN | |
FOR i IN 1..100 LOOP | |
perform count(*) from pg_stat_activity; | |
END LOOP; | |
END | |
\$do\$;" > /dev/null; | |
end=$EPOCHREALTIME | |
echo "Elapsed Time: $((end-start))"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment