Skip to content

Commit 392c8bf

Browse files
committed
feat: add pg_statviz repl and slru collectors
Add collectors for new pg_statviz tables: - pgstatviz.repl: replication statistics (standby lag, slot stats) - pgstatviz.slru: SLRU cache statistics Also standardize all pg_statviz queries to use SELECT * for consistency and to automatically capture new columns. Update copyright year to 2026.
1 parent 4ed125c commit 392c8bf

14 files changed

+32
-18
lines changed

DATA.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ If the pg_statviz extension is installed in a database, these collectors are ava
214214
| `db.tsv` | `pgstatviz.db` | Database statistics |
215215
| `io.tsv` | `pgstatviz.io` | I/O statistics (JSONB, PG16+) |
216216
| `lock.tsv` | `pgstatviz.lock` | Lock statistics (JSONB) |
217+
| `repl.tsv` | `pgstatviz.repl` | Replication statistics (JSONB) |
218+
| `slru.tsv` | `pgstatviz.slru` | SLRU cache statistics (JSONB) |
217219
| `snapshots.tsv` | `pgstatviz.snapshots` | Snapshot timestamps |
218220
| `wait.tsv` | `pgstatviz.wait` | Wait event statistics (JSONB) |
219221
| `wal.tsv` | `pgstatviz.wal` | WAL statistics (PG14+) |

LICENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The PostgreSQL License
22

3-
Portions copyright (c) 2025, pgEdge, Inc.
3+
Portions copyright (c) 2026, pgEdge, Inc.
44

55
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
66

docs/LICENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The PostgreSQL License
22

3-
Portions copyright (c) 2025, pgEdge, Inc.
3+
Portions copyright (c) 2026, pgEdge, Inc.
44

55
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
66

docs/data.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ If the pg_statviz extension is installed in a database, these collectors are ava
219219
| `db.tsv` | `pgstatviz.db` | Database statistics |
220220
| `io.tsv` | `pgstatviz.io` | I/O statistics (JSONB, PG16+) |
221221
| `lock.tsv` | `pgstatviz.lock` | Lock statistics (JSONB) |
222+
| `repl.tsv` | `pgstatviz.repl` | Replication statistics (JSONB) |
223+
| `slru.tsv` | `pgstatviz.slru` | SLRU cache statistics (JSONB) |
222224
| `snapshots.tsv` | `pgstatviz.snapshots` | Snapshot timestamps |
223225
| `wait.tsv` | `pgstatviz.wait` | Wait event statistics (JSONB) |
224226
| `wal.tsv` | `pgstatviz.wal` | WAL statistics (PG14+) |

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ theme:
4646
extra:
4747
generator: false
4848

49-
copyright: Copyright © 2025 pgEdge, Inc
49+
copyright: Copyright © 2026 pgEdge, Inc
5050
repo_url: https://github.com/pgEdge/radar
5151

5252
nav:

postgres.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* radar
44
*
5-
* Portions copyright (c) 2025, pgEdge, Inc.
5+
* Portions copyright (c) 2026, pgEdge, Inc.
66
* This software is released under The PostgreSQL License
77
*
88
*-------------------------------------------------------------------------

postgres_tasks.go

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* radar
44
*
5-
* Portions copyright (c) 2025, pgEdge, Inc.
5+
* Portions copyright (c) 2026, pgEdge, Inc.
66
* This software is released under The PostgreSQL License
77
*
88
*-------------------------------------------------------------------------
@@ -331,12 +331,12 @@ var pgStatvizQueryTasks = []SimpleQueryTask{
331331
{
332332
Name: "pg_statviz_conf",
333333
ArchivePath: "pg_statviz/%s/conf.tsv",
334-
Query: "SELECT snapshot_tstamp, conf::text FROM pgstatviz.conf ORDER BY snapshot_tstamp",
334+
Query: "SELECT * FROM pgstatviz.conf ORDER BY snapshot_tstamp",
335335
},
336336
{
337337
Name: "pg_statviz_conn",
338338
ArchivePath: "pg_statviz/%s/conn.tsv",
339-
Query: "SELECT snapshot_tstamp, conn_total, conn_active, conn_idle, conn_idle_trans, conn_idle_trans_abort, conn_fastpath, conn_users::text FROM pgstatviz.conn ORDER BY snapshot_tstamp",
339+
Query: "SELECT * FROM pgstatviz.conn ORDER BY snapshot_tstamp",
340340
},
341341
{
342342
Name: "pg_statviz_db",
@@ -346,22 +346,32 @@ var pgStatvizQueryTasks = []SimpleQueryTask{
346346
{
347347
Name: "pg_statviz_io",
348348
ArchivePath: "pg_statviz/%s/io.tsv",
349-
Query: "SELECT snapshot_tstamp, io_stats::text, stats_reset FROM pgstatviz.io ORDER BY snapshot_tstamp",
349+
Query: "SELECT * FROM pgstatviz.io ORDER BY snapshot_tstamp",
350350
},
351351
{
352352
Name: "pg_statviz_lock",
353353
ArchivePath: "pg_statviz/%s/lock.tsv",
354-
Query: "SELECT snapshot_tstamp, locks_total, locks::text FROM pgstatviz.lock ORDER BY snapshot_tstamp",
354+
Query: "SELECT * FROM pgstatviz.lock ORDER BY snapshot_tstamp",
355+
},
356+
{
357+
Name: "pg_statviz_repl",
358+
ArchivePath: "pg_statviz/%s/repl.tsv",
359+
Query: "SELECT * FROM pgstatviz.repl ORDER BY snapshot_tstamp",
360+
},
361+
{
362+
Name: "pg_statviz_slru",
363+
ArchivePath: "pg_statviz/%s/slru.tsv",
364+
Query: "SELECT * FROM pgstatviz.slru ORDER BY snapshot_tstamp",
355365
},
356366
{
357367
Name: "pg_statviz_snapshots",
358368
ArchivePath: "pg_statviz/%s/snapshots.tsv",
359-
Query: "SELECT snapshot_tstamp FROM pgstatviz.snapshots ORDER BY snapshot_tstamp",
369+
Query: "SELECT * FROM pgstatviz.snapshots ORDER BY snapshot_tstamp",
360370
},
361371
{
362372
Name: "pg_statviz_wait",
363373
ArchivePath: "pg_statviz/%s/wait.tsv",
364-
Query: "SELECT snapshot_tstamp, wait_events_total, wait_events::text FROM pgstatviz.wait ORDER by snapshot_tstamp",
374+
Query: "SELECT * FROM pgstatviz.wait ORDER BY snapshot_tstamp",
365375
},
366376
{
367377
Name: "pg_statviz_wal",

postgres_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* radar
44
*
5-
* Portions copyright (c) 2025, pgEdge, Inc.
5+
* Portions copyright (c) 2026, pgEdge, Inc.
66
* This software is released under The PostgreSQL License
77
*
88
*-------------------------------------------------------------------------

radar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* radar
44
*
5-
* Portions copyright (c) 2025, pgEdge, Inc.
5+
* Portions copyright (c) 2026, pgEdge, Inc.
66
* This software is released under The PostgreSQL License
77
*
88
*-------------------------------------------------------------------------

radar_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* radar
44
*
5-
* Portions copyright (c) 2025, pgEdge, Inc.
5+
* Portions copyright (c) 2026, pgEdge, Inc.
66
* This software is released under The PostgreSQL License
77
*
88
*-------------------------------------------------------------------------

0 commit comments

Comments
 (0)