|
157 | 157 | 'outputaddress' => 'localhost.foo.com', |
158 | 158 | 'query' => [ |
159 | 159 | { 'sqlquery' => 'SELECT * FROM pg_stat_database', |
160 | | - 'version' => 901, |
161 | 160 | 'withdbname' => false }, |
162 | 161 | { 'tagvalue' => 'table_name', |
163 | | - 'version' => 901, |
164 | 162 | 'withdbname' => false, |
165 | 163 | 'sqlquery' => "SELECT current_database() AS datname, total_bytes AS total , table_name , index_bytes AS index , toast_bytes AS toast , table_bytes AS table FROM ( SELECT *, total_bytes-index_bytes-coalesce(toast_bytes,0) AS table_bytes FROM ( SELECT c.oid,nspname AS table_schema, relname AS table_name , c.reltuples AS row_estimate , pg_total_relation_size(c.oid) AS total_bytes , pg_indexes_size(c.oid) AS index_bytes , pg_total_relation_size(reltoastrelid) AS toast_bytes FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE relkind = 'r' AND nspname NOT IN ('pg_catalog', 'information_schema')) a) a" }, |
166 | 164 | { 'sqlquery' => 'SELECT current_database() AS datname, relname as table, autovacuum_count, vacuum_count, n_live_tup, n_dead_tup FROM pg_stat_user_tables', |
167 | 165 | 'tagvalue' => 'table', |
168 | | - 'version' => 901, |
169 | 166 | 'withdbname' => false }, |
170 | 167 | { 'sqlquery' => 'SELECT current_database() AS datname, a.indexrelname as index, pg_relation_size(a.indexrelid) as size_bytes, idx_scan, idx_tup_read, idx_tup_fetch, idx_blks_read, idx_blks_hit from pg_stat_user_indexes a join pg_statio_user_indexes b on a.indexrelid = b.indexrelid;', |
171 | 168 | 'tagvalue' => 'index', |
172 | | - 'version' => 901, |
173 | 169 | 'withdbname' => false }, |
174 | 170 | { 'sqlquery' => 'SELECT current_database() AS datname, relname as table, 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', 'tagvalue' => 'table', |
175 | | - 'version' => 901, |
176 | 171 | 'withdbname' => false }, |
177 | 172 | ] |
178 | 173 | }] |
|
204 | 199 | }, |
205 | 200 | postgres_hosts: ['localhost.foo.com'], |
206 | 201 | template_format: 'toml', |
| 202 | + include_pe_metrics: false, |
207 | 203 | } |
208 | 204 | end |
209 | 205 |
|
210 | 206 | it { |
211 | 207 | # rubocop:disable Layout/LineLength |
212 | 208 | options = [{ |
213 | | - 'address' => "postgres://[email protected]:5432/pe-puppetdb?#{params[:postgres_options].map { |k, v| "#{k}=#{v}" }.join('&').chomp}", |
214 | | - 'databases' => ['pe-puppetdb'], |
| 209 | + 'address' => "postgres://[email protected]:5432/puppetdb?#{params[:postgres_options].map { |k, v| "#{k}=#{v}" }.join('&').chomp}", |
| 210 | + 'databases' => ['puppetdb'], |
215 | 211 | 'outputaddress' => 'localhost.foo.com', |
216 | 212 | 'query' => [ |
217 | 213 | { 'sqlquery' => 'SELECT * FROM pg_stat_database', |
218 | | - 'version' => 901, |
219 | 214 | 'withdbname' => false }, |
220 | 215 | { 'tagvalue' => 'table_name', |
221 | | - 'version' => 901, |
222 | 216 | 'withdbname' => false, |
223 | 217 | 'sqlquery' => "SELECT current_database() AS datname, total_bytes AS total , table_name , index_bytes AS index , toast_bytes AS toast , table_bytes AS table FROM ( SELECT *, total_bytes-index_bytes-coalesce(toast_bytes,0) AS table_bytes FROM ( SELECT c.oid,nspname AS table_schema, relname AS table_name , c.reltuples AS row_estimate , pg_total_relation_size(c.oid) AS total_bytes , pg_indexes_size(c.oid) AS index_bytes , pg_total_relation_size(reltoastrelid) AS toast_bytes FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE relkind = 'r' AND nspname NOT IN ('pg_catalog', 'information_schema')) a) a" }, |
224 | 218 | { 'sqlquery' => 'SELECT current_database() AS datname, relname as table, autovacuum_count, vacuum_count, n_live_tup, n_dead_tup FROM pg_stat_user_tables', |
225 | 219 | 'tagvalue' => 'table', |
226 | | - 'version' => 901, |
227 | 220 | 'withdbname' => false }, |
228 | 221 | { 'sqlquery' => 'SELECT current_database() AS datname, a.indexrelname as index, pg_relation_size(a.indexrelid) as size_bytes, idx_scan, idx_tup_read, idx_tup_fetch, idx_blks_read, idx_blks_hit from pg_stat_user_indexes a join pg_statio_user_indexes b on a.indexrelid = b.indexrelid;', |
229 | 222 | 'tagvalue' => 'index', |
230 | | - 'version' => 901, |
231 | 223 | 'withdbname' => false }, |
232 | 224 | { 'sqlquery' => 'SELECT current_database() AS datname, relname as table, 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', 'tagvalue' => 'table', |
233 | | - 'version' => 901, |
234 | 225 | 'withdbname' => false }, |
235 | 226 | ] |
236 | 227 | }] |
|
0 commit comments