monitor

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

type Monitor struct {
	Response *listener.MonitorResponse
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor(lo interfaces.Listener) *Monitor

func (*Monitor) ByteCountIEC

func (c *Monitor) ByteCountIEC(b uint64) string

func (*Monitor) ByteCountSI

func (c *Monitor) ByteCountSI(b uint64) string

func (*Monitor) Get

func (c *Monitor) Get() *listener.MonitorResponse

func (*Monitor) Round

func (c *Monitor) Round(num float64) int

func (*Monitor) Start

func (c *Monitor) Start()

func (*Monitor) Stats

func (c *Monitor) Stats() (err error)

func (*Monitor) ToFixed

func (c *Monitor) ToFixed(num float64, precision int) float64

type Stat

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

Stat will store CPU time struct

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

Jump to

Keyboard shortcuts

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