the article for basic introduction here:
https://umangshrestha09.medium.com/create-your-own-system-monitoring-tool-in-linux-b860e480b151
type Bytes struct { Tx uint64 Rx uint64 }
type MemKB struct { MemTotal uint64 MemFree uint64 MemUsed uint64 SwapTotal uint64 SwapFree uint64 SwapUsed uint64 Shared uint64 Cache uint64 }
func GetCurrentCpu(r chan float64);
func GetProcs() int;
func GetHz() uint;
func GetHostName() string;
func GetInterfaceNames() []string;
func GetUptime() float64;
func GetBytes(interfaceName string) Bytes;
func GetMem() MemKB;
func GetListOfPid() []string;
func GetPidCpuAndUptime(pid string) (PidStat, error)
func GetPidMem(pid string) uint64;
func GetPidCommandLine(pid string) (string, error);
func GetPidName(pid string) (string, error);
The output csv of example.go: //epoch, cpu, mUsed, sUsed, cache, uptimeInMin