This file contains 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
-- In pg_stat_statements, there is a problem: sometimes (quite often), it registers the same query twice (or even more). | |
-- It's easy to check in your DB: | |
-- | |
-- with heh as ( | |
-- select userid, dbid, query, count(*), array_agg(queryid) queryids | |
-- from pg_stat_statements group by 1, 2, 3 having count(*) > 1 | |
-- ) select left(query, 85) || '...', userid, dbid, count, queryids from heh; | |
-- | |
-- This query gives you "full picture", aggregating stats for each query-database-username ternary |
This file contains 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
goaccess -f haproxy.log --log-format='%^ %^ %^:%^:%^ %^ %^[%^]: %h:%^ [%d:%t.%^] %^ %^ %^/%^/%^/%^/%L %s %b %^ %^ %^ %^/%^/%^/%^/%^ %^/%^ "%r"' --date-format='%d/%b/%Y' --time-format='%H:%M:%S' -q |
This file contains 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
watch -n 1 'echo "show table http" | socat unix:/var/run/haproxy.sock -' | |
watch -n 1 'echo "show table public" | socat unix:/var/run/haproxy.sock -' |