Last active
November 20, 2018 15:54
-
-
Save tym-xqo/3848b2962612a041e0f5be5b2620ee09 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# invoke with `watch -n 5` | |
hostname | |
uptime | cut -d ',' -f 4-6 | |
free -h | |
echo '' | |
psql -U postgres -c 'select count(*) as conns, state from pg_stat_activity group by 2;' | |
psql -U postgres -c 'select pid, locktype, mode, granted from pg_locks where not granted;' | |
psql -U postgres -c 'select count(*) as total_locks, mode from pg_locks group by 2;' | |
iostat -h 5 2 | tail -n 14 | |
vmstat -S M 1 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment