A cross-platform library for retrieving system and process information in Go, ported from Python's psutil.
gopsutil is a Go library that provides a cross-platform interface for retrieving system and process information, such as CPU, memory, disk, network, and process details. It is a port of the popular Python psutil library, enabling Go developers to access comprehensive system metrics across multiple operating systems without relying on cgo.
Go developers building system monitoring tools, performance dashboards, or infrastructure management applications that require detailed, cross-platform system and process metrics.
Developers choose gopsutil for its comprehensive, pure-Go implementation that avoids cgo dependencies, its extensive cross-platform support (Linux, Windows, macOS, BSD, etc.), and its familiar API modeled after the widely-used psutil library.
psutil for golang
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports Linux, Windows, macOS, BSD variants, and more with architecture-specific implementations, as detailed in the 'Available Architectures' section and compatibility tables.
Implemented entirely in Go by porting C structs, avoiding cgo complexities and dependencies, which simplifies deployment and cross-compilation.
Provides extensive system and process information including CPU times, memory usage, disk I/O, and network connections, with additional gopsutil-specific features like HostInfo.
As a port of Python's psutil, it offers a similar interface, easing migration for developers already familiar with the widely-used library.
Some features are marked as broken or not available on certain platforms, such as virtual_memory on Solaris, requiring developers to handle gaps or workarounds.
Optional caching for metrics like boottime can lead to inconsistencies, as warned in the README due to issues like NTP adjustments after boot.
The introduction of Ex structs for platform-specific info adds complexity, forcing developers to use different functions and structs per OS, which can hinder code portability.