Provides table functions to access system-level statistics for monitoring purpose
Maintainer(s):
dentiny
Compatibility Matrix
This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 |
|---|---|---|---|---|---|
| Linux AMD64 | |||||
| Linux ARM64 | |||||
| macOS AMD64 | |||||
| macOS ARM64 | |||||
| Windows AMD64 | |||||
| Windows ARM64 | |||||
| WebAssembly |
Installing and Loading
INSTALL system_stats FROM community;
LOAD system_stats;
Example
-- Get memory information
SELECT * FROM sys_memory_info();
-- Get CPU information
SELECT * FROM sys_cpu_info();
-- Get disk information
SELECT * FROM sys_disk_info();
-- Get network information
SELECT * FROM sys_network_info();
-- Get OS information
SELECT * FROM sys_os_info();
About system_stats
The system_stats extension provides table functions to access system-level statistics (including memory, CPU, and disk) that can be used for monitoring.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| sys_cpu_info | table | Returns processor identity, architecture, core counts, cache sizes, and byte order for the host system. | NULL | [SELECT * FROM sys_cpu_info();] |
| sys_disk_info | table | Returns mounted filesystem capacity and usage, optionally converted to the requested unit. | NULL | [SELECT * FROM sys_disk_info(unit = 'GiB');] |
| sys_memory_info | table | Returns physical memory and swap usage for the host system, optionally converted to the requested unit. | NULL | [SELECT * FROM sys_memory_info(unit = 'GiB');] |
| sys_network_info | table | Returns IPv4 addresses and traffic counters for the host system's network interfaces. | NULL | [SELECT * FROM sys_network_info();] |
| sys_os_info | table | Returns operating system, host, process, handle, thread, architecture, and uptime information. | NULL | [SELECT * FROM sys_os_info();] |
Overloaded Functions
This extension does not add any function overloads.
Added Types
This extension does not add any types.
Added Settings
| name | description | input_type | scope | aliases | typed_value |
|---|---|---|---|---|---|
| temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp |