2 query: "SELECT CASE WHEN NOT pg_is_in_recovery() THEN 0 ELSE GREATEST (0, EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))) END AS lag_seconds"
7 description: "Replication lag behind master in seconds"
10 query: "SELECT pg_postmaster_start_time as start_time_seconds from pg_postmaster_start_time()"
15 description: "Time at which postmaster started"
16 <% if node[:postgresql][:monitor_tables] -%>
19 query: "SELECT current_database() datname, schemaname, relname, seq_scan, seq_tup_read, idx_scan, idx_tup_fetch, n_tup_ins, n_tup_upd, n_tup_del, n_tup_hot_upd, n_live_tup, n_dead_tup, n_mod_since_analyze, COALESCE(last_vacuum, '1970-01-01Z') as last_vacuum, COALESCE(last_autovacuum, '1970-01-01Z') as last_autovacuum, COALESCE(last_analyze, '1970-01-01Z') as last_analyze, COALESCE(last_autoanalyze, '1970-01-01Z') as last_autoanalyze, vacuum_count, autovacuum_count, analyze_count, autoanalyze_count FROM pg_stat_user_tables"
23 description: "Name of current database"
26 description: "Name of the schema that this table is in"
29 description: "Name of this table"
32 description: "Number of sequential scans initiated on this table"
35 description: "Number of live rows fetched by sequential scans"
38 description: "Number of index scans initiated on this table"
41 description: "Number of live rows fetched by index scans"
44 description: "Number of rows inserted"
47 description: "Number of rows updated"
50 description: "Number of rows deleted"
53 description: "Number of rows HOT updated (i.e., with no separate index update required)"
56 description: "Estimated number of live rows"
59 description: "Estimated number of dead rows"
60 - n_mod_since_analyze:
62 description: "Estimated number of rows changed since last analyze"
65 description: "Last time at which this table was manually vacuumed (not counting VACUUM FULL)"
68 description: "Last time at which this table was vacuumed by the autovacuum daemon"
71 description: "Last time at which this table was manually analyzed"
74 description: "Last time at which this table was analyzed by the autovacuum daemon"
77 description: "Number of times this table has been manually vacuumed (not counting VACUUM FULL)"
80 description: "Number of times this table has been vacuumed by the autovacuum daemon"
83 description: "Number of times this table has been manually analyzed"
86 description: "Number of times this table has been analyzed by the autovacuum daemon"
88 pg_statio_user_tables:
89 query: "SELECT current_database() datname, schemaname, relname, heap_blks_read, heap_blks_hit, idx_blks_read, idx_blks_hit, toast_blks_read, toast_blks_hit, tidx_blks_read, tidx_blks_hit FROM pg_statio_user_tables"
93 description: "Name of current database"
96 description: "Name of the schema that this table is in"
99 description: "Name of this table"
102 description: "Number of disk blocks read from this table"
105 description: "Number of buffer hits in this table"
108 description: "Number of disk blocks read from all indexes on this table"
111 description: "Number of buffer hits in all indexes on this table"
114 description: "Number of disk blocks read from this table's TOAST table (if any)"
117 description: "Number of buffer hits in this table's TOAST table (if any)"
120 description: "Number of disk blocks read from this table's TOAST table indexes (if any)"
123 description: "Number of buffer hits in this table's TOAST table indexes (if any)"
127 query: "SELECT current_database() AS datname, max(age(relfrozenxid)) AS xid_age, max(mxid_age(relminmxid)) AS mxid_age FROM pg_class WHERE relkind IN ('r', 'm')"
131 description: "Name of the database"
134 description: "Age of the oldest unfrozen transaction ID in this database"
137 description: "Age of the oldest unfrozen multixact ID in this database"