Created
December 22, 2011 19:11
-
-
Save outworlder/1511462 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
;;; Collect Postgresql statistics | |
(use postgresql) | |
(define connection-string (make-parameter '((host . "<ip>") | |
(user . "<user here>") | |
(dbname . "<db name here>")))) | |
(define conn (connect (connection-string))) | |
(define (get-stats) | |
(row-map (lambda (x) | |
(print x)) (query conn "select sum(xact_commit) from pg_stat_database")) | |
(sleep 5) | |
(get-stats)) | |
(get-stats) | |
(disconnect conn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment