From: Sebastian Harl Date: Fri, 26 Oct 2012 08:25:45 +0000 (+0200) Subject: postgresql_default.conf: Added _by_table variants for all table-related qries. X-Git-Tag: collectd-5.2.0~14^2~1 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=40cda8599de2cb1a5b4c912df36b50dd12657068 postgresql_default.conf: Added _by_table variants for all table-related qries. These queries use the 'schemaname' and 'relname' columns to construct the type instance. --- diff --git a/src/postgresql_default.conf b/src/postgresql_default.conf index 83a32c77..f905eb2a 100644 --- a/src/postgresql_default.conf +++ b/src/postgresql_default.conf @@ -93,6 +93,71 @@ 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 + + Statement "SELECT sum(seq_scan) AS seq, \ sum(seq_tup_read) AS seq_tup_read, \ @@ -140,6 +205,61 @@ MinVersion 80300 + + Statement "SELECT schemaname, relname, \ + seq_scan AS seq, \ + seq_tup_read AS seq_tup_read, \ + idx_scan AS idx, \ + idx_tup_fetch 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;" + + + 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 + + Statement "SELECT coalesce(sum(heap_blks_read), 0) AS heap_read, \ coalesce(sum(heap_blks_hit), 0) AS heap_hit, \ @@ -193,6 +313,68 @@ + + 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;" + + + 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" + + + Statement "SELECT pg_database_size($1) AS size;"