Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/c9s/goprocinfo
Linux /proc info parser for Go
https://github.com/c9s/goprocinfo
Last synced: 25 days ago
JSON representation
Linux /proc info parser for Go
- Host: GitHub
- URL: https://github.com/c9s/goprocinfo
- Owner: c9s
- License: mit
- Created: 2013-11-17T09:48:21.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2021-01-30T14:39:24.000Z (almost 4 years ago)
- Last Synced: 2024-05-21T18:07:24.413Z (6 months ago)
- Language: Go
- Homepage:
- Size: 241 KB
- Stars: 746
- Watchers: 26
- Forks: 100
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
goprocinfo
===================/proc information parser for Go.
Usage
---------------```go
import (
"log"linuxproc "github.com/c9s/goprocinfo/linux"
)stat, err := linuxproc.ReadStat("/proc/stat")
if err != nil {
log.Fatal("stat read fail")
}for _, s := range stat.CPUStats {
// s.User
// s.Nice
// s.System
// s.Idle
// s.IOWait
}// stat.CPUStatAll
// stat.CPUStats
// stat.Processes
// stat.BootTime
// ... etc
```Documentation
---------------Full documentation is available at [Godoc](https://godoc.org/github.com/c9s/goprocinfo/linux).
Reference
------------* http://www.mjmwired.net/kernel/Documentation/filesystems/proc.txt
License
-------goprocinfo is distributed under the MIT license.