Skip to content

Instantly share code, notes, and snippets.

@digi0ps
Last active April 19, 2020 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digi0ps/8ce8b9b172705d3d7dcae4d61ced4708 to your computer and use it in GitHub Desktop.
Save digi0ps/8ce8b9b172705d3d7dcae4d61ced4708 to your computer and use it in GitHub Desktop.
Postgres testing without active connection
#! /bin/zsh
zmodload zsh/datetime
start=$EPOCHREALTIME
for i in {1..100};
do
PGPASSWORD=password psql -U localadmin testing -c "select count(*) from pg_stat_activity;" > /dev/null;
done
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