1
0
mirror of https://github.com/prometheus-community/postgres_exporter.git synced 2025-07-30 09:43:10 +03:00

stat_user_tables: Add total size metric (#904)

Signed-off-by: David Cook <dcook@divviup.org>
This commit is contained in:
David Cook
2023-09-12 08:07:36 -05:00
committed by GitHub
parent 0b6d9860ab
commit 31ef4ed5a2
2 changed files with 28 additions and 6 deletions

View File

@ -71,7 +71,8 @@ func TestPGStatUserTablesCollector(t *testing.T) {
"vacuum_count",
"autovacuum_count",
"analyze_count",
"autoanalyze_count"}
"autoanalyze_count",
"total_size"}
rows := sqlmock.NewRows(columns).
AddRow("postgres",
"public",
@ -94,7 +95,8 @@ func TestPGStatUserTablesCollector(t *testing.T) {
11,
12,
13,
14)
14,
15)
mock.ExpectQuery(sanitizeQuery(statUserTablesQuery)).WillReturnRows(rows)
ch := make(chan prometheus.Metric)
go func() {
@ -170,7 +172,8 @@ func TestPGStatUserTablesCollectorNullValues(t *testing.T) {
"vacuum_count",
"autovacuum_count",
"analyze_count",
"autoanalyze_count"}
"autoanalyze_count",
"total_size"}
rows := sqlmock.NewRows(columns).
AddRow("postgres",
nil,
@ -193,6 +196,7 @@ func TestPGStatUserTablesCollectorNullValues(t *testing.T) {
nil,
nil,
nil,
nil,
nil)
mock.ExpectQuery(sanitizeQuery(statUserTablesQuery)).WillReturnRows(rows)
ch := make(chan prometheus.Metric)