myos

package
v0.0.0-...-ad947ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateCpuPercent

func CalculateCpuPercent(t1, t2 *cpu.TimesStat, delta float64, numcpu int) float64

func GetProcessCpuInterval

func GetProcessCpuInterval(p *process.Process, interval uint32) (float64, error)

func GetProcessCpuPercentInterval

func GetProcessCpuPercentInterval(pid int32, interval uint32) (float64, error)

Types

type CpuTimes

type CpuTimes struct {
	TheCPUTimes *cpu.TimesStat
	TheCPUTime  time.Time
}

func GetProcessCpuTimes

func GetProcessCpuTimes(pid int32) (CpuTimes, error)

type OSMemStats

type OSMemStats struct {
	SwapTotal       uint64
	SwapUsed        uint64
	SwapFree        uint64
	SwapUsedPercent float64
	SwapIn          uint64
	SwapOut         uint64

	MemTotal       uint64
	MemAvailable   uint64
	MemUsed        uint64
	MemUsedPercent float64
	MemBuffers     uint64
	MemCached      uint64
}

func GetOsMemStats

func GetOsMemStats() (OSMemStats, error)

type ProcessStats

type ProcessStats struct {
	FirstErr bool

	MemPercent   float64
	GetMemPerErr bool

	GetMemErr bool
	MemRSS    uint64
	MemVMS    uint64
	MemSwap   uint64

	GetIoErr  bool
	IoRdcnt   uint64
	IoWrcnt   uint64
	IoRdBytes uint64
	IoWrBytes uint64

	GetCtxErr            bool
	CtxSwitchVoluntary   int64
	CtxSwitchInvoluntary int64
}

func GetProcessStatsWithoutCpu

func GetProcessStatsWithoutCpu(pid int32) (ProcessStats, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL