X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fpostgresql_default.conf;h=0aac41e296cb5c87681e3ce41372afbaeea9617d;hb=fc2993befd2d9d6d9392cf109f033d0d6f421436;hp=9d21217cecbdc5db1110775024a6558992ad28c4;hpb=ed365605bab34d082123289127e9d5002b4d7bc5;p=collectd.git
diff --git a/src/postgresql_default.conf b/src/postgresql_default.conf
index 9d21217c..0aac41e2 100644
--- a/src/postgresql_default.conf
+++ b/src/postgresql_default.conf
@@ -1,78 +1,390 @@
# Pre-defined queries of collectd's postgresql plugin.
+#
+# Do not edit this file. If you want to change any of the query definitions,
+# overwrite them in collectd.conf instead.
+#
+# This file is distributed under the same terms as collectd itself.
- Query "SELECT count(*) \
+ Statement "SELECT count(*) AS count \
FROM pg_stat_activity \
WHERE datname = $1;"
Param database
- Column pg_numbackends
+
+ Type "pg_numbackends"
+ ValuesFrom "count"
+
- Query "SELECT xact_commit, xact_rollback \
+ Statement "SELECT xact_commit, xact_rollback \
FROM pg_stat_database \
WHERE datname = $1;"
Param database
- Column pg_xact commit
- Column pg_xact rollback
+
+ Type "pg_xact"
+ InstancePrefix "commit"
+ ValuesFrom "xact_commit"
+
+
+ Type "pg_xact"
+ InstancePrefix "rollback"
+ ValuesFrom "xact_rollback"
+
- Query "SELECT sum(n_tup_ins), sum(n_tup_upd), sum(n_tup_del), \
- sum(n_tup_hot_upd) \
+ Statement "SELECT sum(n_tup_ins) AS ins, \
+ sum(n_tup_upd) AS upd, \
+ sum(n_tup_del) AS del \
FROM pg_stat_user_tables;"
- Column pg_n_tup_c ins
- Column pg_n_tup_c upd
- Column pg_n_tup_c del
- Column pg_n_tup_c hot_upd
+
+ Type "pg_n_tup_c"
+ InstancePrefix "ins"
+ ValuesFrom "ins"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "upd"
+ ValuesFrom "upd"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "del"
+ ValuesFrom "del"
+
+
+ MaxVersion 80299
+
+
+
+ Statement "SELECT sum(n_tup_ins) AS ins, \
+ sum(n_tup_upd) AS upd, \
+ sum(n_tup_del) AS del, \
+ sum(n_tup_hot_upd) AS hot_upd \
+ FROM pg_stat_user_tables;"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "ins"
+ ValuesFrom "ins"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "upd"
+ ValuesFrom "upd"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "del"
+ ValuesFrom "del"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "hot_upd"
+ ValuesFrom "hot_upd"
+
+
+ MinVersion 80300
+
+
+
+ Statement "SELECT schemaname, relname, \
+ n_tup_ins AS ins, \
+ n_tup_upd AS upd, \
+ n_tup_del AS del \
+ FROM pg_stat_user_tables;"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "ins"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "ins"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "upd"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "upd"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "del"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "del"
+
+
+ MaxVersion 80299
+
+
+
+ Statement "SELECT schemaname, relname, \
+ n_tup_ins AS ins, \
+ n_tup_upd AS upd, \
+ n_tup_del AS del, \
+ n_tup_hot_upd AS hot_upd \
+ FROM pg_stat_user_tables;"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "ins"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "ins"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "upd"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "upd"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "del"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "del"
+
+
+ Type "pg_n_tup_c"
+ InstancePrefix "hot_upd"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "hot_upd"
+
+
+ MinVersion 80300
- Query "SELECT sum(seq_scan), sum(seq_tup_read), \
- sum(idx_scan), sum(idx_tup_fetch) \
+ Statement "SELECT coalesce(sum(seq_scan), 0) AS seq, \
+ coalesce(sum(seq_tup_read), 0) AS seq_tup_read, \
+ coalesce(sum(idx_scan), 0) AS idx, \
+ coalesce(sum(idx_tup_fetch), 0) AS idx_tup_fetch \
FROM pg_stat_user_tables;"
- Column pg_scan seq
- Column pg_scan seq_tup_read
- Column pg_scan idx
- Column pg_scan idx_tup_fetch
+
+ Type "pg_scan"
+ InstancePrefix "seq"
+ ValuesFrom "seq"
+
+
+ Type "pg_scan"
+ InstancePrefix "seq_tup_read"
+ ValuesFrom "seq_tup_read"
+
+
+ Type "pg_scan"
+ InstancePrefix "idx"
+ ValuesFrom "idx"
+
+
+ Type "pg_scan"
+ InstancePrefix "idx_tup_fetch"
+ ValuesFrom "idx_tup_fetch"
+
- Query "SELECT sum(n_live_tup), sum(n_dead_tup) \
+ Statement "SELECT sum(n_live_tup) AS live, sum(n_dead_tup) AS dead \
+ FROM pg_stat_user_tables;"
+
+
+ Type "pg_n_tup_g"
+ InstancePrefix "live"
+ ValuesFrom "live"
+
+
+ Type "pg_n_tup_g"
+ InstancePrefix "dead"
+ ValuesFrom "dead"
+
+
+ MinVersion 80300
+
+
+
+ Statement "SELECT schemaname, relname, \
+ coalesce(seq_scan, 0) AS seq, \
+ coalesce(seq_tup_read, 0) AS seq_tup_read, \
+ coalesce(idx_scan, 0) AS idx, \
+ coalesce(idx_tup_fetch, 0) AS idx_tup_fetch \
+ FROM pg_stat_user_tables;"
+
+
+ Type "pg_scan"
+ InstancePrefix "seq"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "seq"
+
+
+ Type "pg_scan"
+ InstancePrefix "seq_tup_read"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "seq_tup_read"
+
+
+ Type "pg_scan"
+ InstancePrefix "idx"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "idx"
+
+
+ Type "pg_scan"
+ InstancePrefix "idx_tup_fetch"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "idx_tup_fetch"
+
+
+
+
+ Statement "SELECT schemaname, relname, \
+ n_live_tup AS live, n_dead_tup AS dead \
FROM pg_stat_user_tables;"
- Column pg_n_tup_g live
- Column pg_n_tup_g dead
+
+ Type "pg_n_tup_g"
+ InstancePrefix "live"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "live"
+
+
+ Type "pg_n_tup_g"
+ InstancePrefix "dead"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "dead"
+
+
+ MinVersion 80300
- Query "SELECT sum(heap_blks_read), sum(heap_blks_hit), \
- sum(idx_blks_read), sum(idx_blks_hit), \
- sum(toast_blks_read), sum(toast_blks_hit), \
- sum(tidx_blks_read), sum(tidx_blks_hit) \
+ Statement "SELECT coalesce(sum(heap_blks_read), 0) AS heap_read, \
+ coalesce(sum(heap_blks_hit), 0) AS heap_hit, \
+ coalesce(sum(idx_blks_read), 0) AS idx_read, \
+ coalesce(sum(idx_blks_hit), 0) AS idx_hit, \
+ coalesce(sum(toast_blks_read), 0) AS toast_read, \
+ coalesce(sum(toast_blks_hit), 0) AS toast_hit, \
+ coalesce(sum(tidx_blks_read), 0) AS tidx_read, \
+ coalesce(sum(tidx_blks_hit), 0) AS tidx_hit \
+ FROM pg_statio_user_tables;"
+
+
+ Type "pg_blks"
+ InstancePrefix "heap_read"
+ ValuesFrom "heap_read"
+
+
+ Type "pg_blks"
+ InstancePrefix "heap_hit"
+ ValuesFrom "heap_hit"
+
+
+ Type "pg_blks"
+ InstancePrefix "idx_read"
+ ValuesFrom "idx_read"
+
+
+ Type "pg_blks"
+ InstancePrefix "idx_hit"
+ ValuesFrom "idx_hit"
+
+
+ Type "pg_blks"
+ InstancePrefix "toast_read"
+ ValuesFrom "toast_read"
+
+
+ Type "pg_blks"
+ InstancePrefix "toast_hit"
+ ValuesFrom "toast_hit"
+
+
+ Type "pg_blks"
+ InstancePrefix "tidx_read"
+ ValuesFrom "tidx_read"
+
+
+ Type "pg_blks"
+ InstancePrefix "tidx_hit"
+ ValuesFrom "tidx_hit"
+
+
+
+
+ Statement "SELECT schemaname, relname, \
+ coalesce(heap_blks_read, 0) AS heap_read, \
+ coalesce(heap_blks_hit, 0) AS heap_hit, \
+ coalesce(idx_blks_read, 0) AS idx_read, \
+ coalesce(idx_blks_hit, 0) AS idx_hit, \
+ coalesce(toast_blks_read, 0) AS toast_read, \
+ coalesce(toast_blks_hit, 0) AS toast_hit, \
+ coalesce(tidx_blks_read, 0) AS tidx_read, \
+ coalesce(tidx_blks_hit, 0) AS tidx_hit \
FROM pg_statio_user_tables;"
- Column pg_blks heap_read
- Column pg_blks heap_hit
- Column pg_blks idx_read
- Column pg_blks idx_hit
- Column pg_blks toast_read
- Column pg_blks toast_hit
- Column pg_blks tidx_read
- Column pg_blks tidx_hit
+
+ Type "pg_blks"
+ InstancePrefix "heap_read"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "heap_read"
+
+
+ Type "pg_blks"
+ InstancePrefix "heap_hit"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "heap_hit"
+
+
+ Type "pg_blks"
+ InstancePrefix "idx_read"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "idx_read"
+
+
+ Type "pg_blks"
+ InstancePrefix "idx_hit"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "idx_hit"
+
+
+ Type "pg_blks"
+ InstancePrefix "toast_read"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "toast_read"
+
+
+ Type "pg_blks"
+ InstancePrefix "toast_hit"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "toast_hit"
+
+
+ Type "pg_blks"
+ InstancePrefix "tidx_read"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "tidx_read"
+
+
+ Type "pg_blks"
+ InstancePrefix "tidx_hit"
+ InstancesFrom "schemaname" "relname"
+ ValuesFrom "tidx_hit"
+
- Query "SELECT pg_database_size($1);"
+ Statement "SELECT pg_database_size($1) AS size;"
Param database
- Column pg_db_size
+
+ Type pg_db_size
+ ValuesFrom "size"
+
+# vim: set ft=config :
+