/proc information parser for 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
Full documentation is available at Godoc.
goprocinfo is distributed under the MIT license.
5,205 followers · starred May 2023
1,040 followers · starred Jun 2021
312 followers · starred Nov 2014
244 followers · starred Dec 2015
/proc information parser for 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
Full documentation is available at Godoc.
goprocinfo is distributed under the MIT license.
5,205 followers · starred May 2023
1,040 followers · starred Jun 2021
312 followers · starred Nov 2014
244 followers · starred Dec 2015