summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/postgres/postgres.chart.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-26 18:05:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-26 18:05:10 +0000
commit34a0b66bc2d48223748ed1cf5bc1b305c396bd74 (patch)
treefbd36be86cc6bc4288fe627f2b5beada569848bb /collectors/python.d.plugin/postgres/postgres.chart.py
parentAdding upstream version 1.32.1. (diff)
downloadnetdata-34a0b66bc2d48223748ed1cf5bc1b305c396bd74.tar.xz
netdata-34a0b66bc2d48223748ed1cf5bc1b305c396bd74.zip
Adding upstream version 1.33.0.upstream/1.33.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/python.d.plugin/postgres/postgres.chart.py')
-rw-r--r--collectors/python.d.plugin/postgres/postgres.chart.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/collectors/python.d.plugin/postgres/postgres.chart.py b/collectors/python.d.plugin/postgres/postgres.chart.py
index 29026a6a3..bd8f71a66 100644
--- a/collectors/python.d.plugin/postgres/postgres.chart.py
+++ b/collectors/python.d.plugin/postgres/postgres.chart.py
@@ -336,18 +336,18 @@ WHERE d.datallowconn;
QUERY_TABLE_STATS = {
DEFAULT: """
SELECT
- ((sum(relpages) * 8) * 1024) AS table_size,
- count(1) AS table_count
+ sum(relpages) * current_setting('block_size')::numeric AS table_size,
+ count(1) AS table_count
FROM pg_class
-WHERE relkind IN ('r', 't');
+WHERE relkind IN ('r', 't', 'm');
""",
}
QUERY_INDEX_STATS = {
DEFAULT: """
SELECT
- ((sum(relpages) * 8) * 1024) AS index_size,
- count(1) AS index_count
+ sum(relpages) * current_setting('block_size')::numeric AS index_size,
+ count(1) AS index_count
FROM pg_class
WHERE relkind = 'i';
""",