Skip to content

pgsyswatch

Host process, CPU, memory, swap, network, and load statistics exposed through SQL.

pgsyswatch · Host process, CPU, memory, swap, network, and load statistics exposed through SQL.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101946pgsyswatchpgsyswatch1.0STATApache-2.0C

Usage

Sources:

pgsyswatch Host process, CPU, memory, swap, network, and load statistics exposed through SQL.

Enablement

Merge pgsyswatch into the existing preload list, restart PostgreSQL, and then create pgsyswatch in each database that needs its SQL objects:

shared_preload_libraries = 'pgsyswatch'
CREATE EXTENSION pgsyswatch;

Core Workflow

The following example is taken from the reviewed upstream documentation. Adapt object names, paths, credentials, and workload values before use.

select * from  pgsyswatch.net_and_loadavg_snapshots;

Main Objects

The reviewed install surface includes these prominent objects:

ObjectKindOperational role
proc_activity_snapshotsTABLEExtension-owned table; account for its data in backup and upgrades.
pgsyswatch.net_and_loadavgVIEWInspection or query view created by the extension.
proc_monitor_allFUNCTIONCallable function from the reviewed install surface.
net_and_loadavg_snapshotsTABLEExtension-owned table; account for its data in backup and upgrades.
pg_proc_activityVIEWInspection or query view created by the extension.
cpu_frequenciesFUNCTIONCallable function from the reviewed install surface.
manage_partitions_maintenanceFUNCTIONCallable function from the reviewed install surface.

Operations and Boundaries

  • Preloading pgsyswatch changes cluster startup state; stage configuration and restart changes separately from CREATE EXTENSION.

Table reader