monitor

package
v0.0.0-...-9e6d8ee Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllStats

type AllStats struct {
	Scope      string
	Name       string
	CPU        float64
	RAM        float64
	LastUpdate time.Time
	Data       []Stats
}

AllStats -

type App

type App struct {
	Value struct {
		CPU float64
		RAM float64
	}
}

App -

func GetAppStats

func GetAppStats(pid int) *App

GetAppStats -

type IOCount

type IOCount struct {
	Sent          int64
	Receive       int64
	Pid           int
	NumGoroutine  int
	NumbOfThreads int
}

IOCount -

type SendPid

type SendPid struct {
	Scope string
	Name  string
	Pid   int
}

SendPid -

type Stat

type Stat struct {
	// contains filtered or unexported fields
}

Stat will store CPU time struct

type Stats

type Stats struct {
	Scope   string
	Name    string
	Pid     int
	CPU     float64
	RAM     float64
	Path    string
	Cmdline []string
	IOCount IOCount
	Status  rates.SendStatus
}

Stats -

type SysInfo

type SysInfo struct {
	CPU    float64
	Memory float64
}

SysInfo will record cpu and memory data

func GetStat

func GetStat(pid int) (*SysInfo, error)

GetStat will return current system CPU and memory data

type System

type System struct {
	CPU struct {
		Core    int     `json:"core"`
		Thread  int     `json:"thread"`
		Percent float64 `json:"percent"`
	} `json:"cpu"`
	RAM struct {
		Total       uint64  `json:"total"`
		Used        uint64  `json:"used"`
		UsedPercent float64 `json:"usedPercent"`
	} `json:"ram"`
	Host struct {
		BootTime time.Time `json:"bootTime"`
	} `json:"host"`
}

System -

func GetSystemStats

func GetSystemStats() (ss System)

GetSystemStats -

Jump to

Keyboard shortcuts

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