This repository implements a human-friendly lib for querying processes, memory info and cpu info
Get the package
go get github.com/codescalersinternships/psutil-golang-RawanMostafa
Import the package
import github.com/codescalersinternships/psutil-golang-RawanMostafa/pkg
The psutils package offers different APIs like:
cpuInfo, err := psutils.GetCpuInfo()
if err != nil {
//handle the error
}
memInfo, err := psutils.GetMemInfo()
if err != nil {
//handle the error
}
-
procs, err := psutils.GetProcessList() if err != nil { //handle the error }
-
procDetails, err := psutils.GetProcessDetails(1) if err != nil { //handle the error }