Skip to content

Instantly share code, notes, and snippets.

@tym-xqo
Last active November 20, 2018 15:54
Show Gist options
  • Save tym-xqo/3848b2962612a041e0f5be5b2620ee09 to your computer and use it in GitHub Desktop.
Save tym-xqo/3848b2962612a041e0f5be5b2620ee09 to your computer and use it in GitHub Desktop.
#!/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