-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(pgadmin): system_stats postgres extension
- Loading branch information
1 parent
fb6de01
commit f276f59
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,34 @@ | |
}; | ||
} | ||
``` | ||
|
||
## Guide | ||
|
||
### Visualize system statistics | ||
|
||
`pgAdmin` uses the functions exposed by [system_stats](https://github.com/EnterpriseDB/system_stats) [[postgresql]] extension to monitor the system metrics such as CPU, memory and disk information. Use this in your config: | ||
|
||
```nix | ||
# In `perSystem.process-compose.<name>` | ||
{ | ||
services.postgres."pg1" = { | ||
enable = true; | ||
extensions = exts: [ | ||
exts.system_stats | ||
]; | ||
# This creates the extensions for the `postgres` database, if you need it for a custom database, | ||
# ensure to add the below script in `schemas` of the database of your choice under `initialDatabses`. | ||
initialScript.before = '' | ||
CREATE EXTENSION system_stats; | ||
''; | ||
}; | ||
services.pgadmin."pgad1" = { | ||
enable = true; | ||
initialEmail = "[email protected]"; | ||
initialPassword = "password"; | ||
}; | ||
} | ||
``` | ||
|
||
Open the pgAdmin dashboard, establish a connection with your database and you will see: | ||
![[pgadmin-system-stats.png]] |