Skip to content

Commit

Permalink
feat(alias): add pg_connections
Browse files Browse the repository at this point in the history
  • Loading branch information
denolfe committed Jul 31, 2024
1 parent d508295 commit bd4c01f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aliases/zsh.aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ alias jqkeys="jq -r 'select(objects)|=[.] | map( paths(scalars) ) | map( map(sel

# Bounce Flux
alias reflux='osascript -e "tell application \"Flux\" to quit" && sleep 1 && open -a Flux'

function pg_connections() {
while true; do echo "$(date '+%H:%M:%S') - Active connections: $(psql -c 'SELECT COUNT(*) FROM pg_stat_activity;' -t -A)"; sleep 0.5; done
}

0 comments on commit bd4c01f

Please sign in to comment.