Created
July 13, 2016 08:48
-
-
Save dialogbox/17acde133798c76a3e5cde15f28d600c to your computer and use it in GitHub Desktop.
Query for monitoring wal log population.
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
DO $$ | |
DECLARE | |
cur pg_lsn; | |
cur2 pg_lsn; | |
BEGIN | |
cur := pg_current_xlog_location(); | |
loop | |
execute pg_sleep(5); | |
cur2 := pg_current_xlog_location(); | |
RAISE NOTICE '% : %/s', to_char(clock_timestamp(), 'YYYY/MM/DD HH24:MI:SS'), pg_size_pretty(pg_xlog_location_diff(cur2, cur)/5); | |
cur := cur2; | |
end loop; | |
END | |
$$ ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment