@cryptotaxi247 / netdata-1 / commits / 3acbf4993

Remove operations charts as pg_statio_all_tables only returns info on current database.

Remove operations charts as pg_statio_all_tables only returns info on current database.

Facetoe committed Oct 23, 2016 at 20:47 UTC 3acbf4993f9f34d282347058532ec3299c0f2261
1 file changed +1 -54
python.d/postgres.chart.py
+1 -54
@@ -76,21 +76,6 @@ WHERE NOT datname ~* '^template\d+'
76 GROUP BY database_name;
77 """
78
79 -STATIO = """
80 -SELECT
81 - sum(heap_blks_read) AS heap_blocks_read,
82 - sum(heap_blks_hit) AS heap_blocks_hit,
83 - sum(idx_blks_read) AS index_blocks_read,
84 - sum(idx_blks_hit) AS index_blocks_hit,
85 - sum(toast_blks_read) AS toast_blocks_read,
86 - sum(toast_blks_hit) AS toast_blocks_hit,
87 - sum(tidx_blks_read) AS toastindex_blocks_read,
88 - sum(tidx_blks_hit) AS toastindex_blocks_hit
89 -FROM
90 - pg_statio_all_tables
91 -WHERE
92 - schemaname <> 'pg_catalog';
93 -"""
79 BGWRITER = 'SELECT * FROM pg_stat_bgwriter;'
80 DATABASE_LOCKS = """
81 SELECT
@@ -133,8 +118,7 @@ LOCK_TYPES = [
118 ]
119
120 ORDER = ['db_stat_transactions', 'db_stat_tuple_read', 'db_stat_tuple_returned', 'db_stat_tuple_write',
136 - 'backend_process', 'index_count', 'index_size', 'table_count', 'table_size', 'wal', 'operations_heap',
137 - 'operations_index', 'operations_toast', 'operations_toast_index', 'background_writer']
121 + 'backend_process', 'index_count', 'index_size', 'table_count', 'table_size', 'wal', 'background_writer']
122
123 CHARTS = {
124 'db_stat_transactions': {
@@ -201,30 +185,6 @@ CHARTS = {
185 ['wal_ready', 'Ready', 'absolute'],
186 ['wal_done', 'Done', 'absolute']
187 ]},
204 - 'operations_heap': {
205 - 'options': [None, 'Heap', 'iops', 'IO Operations', 'postgres.operations_heap', 'line'],
206 - 'lines': [
207 - ['operations_heap_blocks_read', 'Read', 'absolute'],
208 - ['operations_heap_blocks_hit', 'Hit', 'absolute']
209 - ]},
210 - 'operations_index': {
211 - 'options': [None, 'Index', 'iops', 'IO Operations', 'postgres.operations_index', 'line'],
212 - 'lines': [
213 - ['operations_index_blocks_read', 'Read', 'absolute'],
214 - ['operations_index_blocks_hit', 'Hit', 'absolute']
215 - ]},
216 - 'operations_toast': {
217 - 'options': [None, 'Toast', 'iops', 'IO Operations', 'postgres.operations_toast', 'line'],
218 - 'lines': [
219 - ['operations_toast_blocks_read', 'Read', 'absolute'],
220 - ['operations_toast_blocks_hit', 'Hit', 'absolute']
221 - ]},
222 - 'operations_toast_index': {
223 - 'options': [None, 'Toast index', 'iops', 'IO Operations', 'postgres.operations_toast_index', 'line'],
224 - 'lines': [
225 - ['operations_toastindex_blocks_read', 'Read', 'absolute'],
226 - ['operations_toastindex_blocks_hit', 'Hit', 'absolute']
227 - ]},
188 'background_writer': {
189 'options': [None, 'Checkpoints', 'Count', 'Background Writer', 'postgres.background_writer', 'line'],
190 'lines': [
@@ -344,7 +304,6 @@ class Service(SimpleService):
304 self.add_index_stats(cursor)
305 self.add_table_stats(cursor)
306 self.add_lock_stats(cursor)
347 - self.add_statio_stats(cursor)
307 self.add_bgwriter_stats(cursor)
308
309 # self.add_replication_stats(cursor)
@@ -410,18 +369,6 @@ class Service(SimpleService):
369 self.add_derive_value('wal_ready', int(temp.get('ready_count', 0)))
370 self.add_derive_value('wal_done', int(temp.get('done_count', 0)))
371
413 - def add_statio_stats(self, cursor):
414 - cursor.execute(STATIO)
415 - temp = cursor.fetchone()
416 - self.add_derive_value('operations_heap_blocks_read', int(temp.get('heap_blocks_read', 0)))
417 - self.add_derive_value('operations_heap_blocks_hit', int(temp.get('heap_blocks_hit', 0)))
418 - self.add_derive_value('operations_index_blocks_read', int(temp.get('index_blocks_read', 0)))
419 - self.add_derive_value('operations_index_blocks_hit', int(temp.get('index_blocks_hit', 0)))
420 - self.add_derive_value('operations_toast_blocks_read', int(temp.get('toast_blocks_read', 0)))
421 - self.add_derive_value('operations_toast_blocks_hit', int(temp.get('toast_blocks_hit', 0)))
422 - self.add_derive_value('operations_toastindex_blocks_read', int(temp.get('toastindex_blocks_read', 0)))
423 - self.add_derive_value('operations_toastindex_blocks_hit', int(temp.get('toastindex_blocks_hit', 0)))
424 -
372 def add_bgwriter_stats(self, cursor):
373 cursor.execute(BGWRITER)
374 temp = cursor.fetchone()