Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 569 Bytes

README.md

File metadata and controls

36 lines (27 loc) · 569 Bytes

goprocinfo

/proc information parser for Go, includes a fix for older kernels

Usage

import linuxproc "github.com/nlacey/goprocinfo/linux"

stat, err := linuxproc.ReadStat("/proc/stat")
if err != nil {
    t.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

Reference