os

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotOSCPU            = errors.New("not contain cpu")
	ErrOSCPUParseErrNoInfo = errors.New("stat does not contain cpu info")
)
View Source
var (
	ErrUnknownScanErr = errors.New("scan failed")
	ErrNoMemInfoFile  = errors.New("not /proc/meminfo file")
)

Functions

func GetMemInfo added in v0.1.5

func GetMemInfo(f io.ReadSeeker) (uint64, uint64, error)

func NewCPULazy

func NewCPULazy(
	done chan struct{},
	conf rescommon.ResourceConfiger,
	dur time.Duration,
) (rescommon.ResourceViewer, error)

func NewCPUSimple

func NewCPUSimple() (rescommon.ResourceViewer, error)

func NewMemLazy

func NewMemLazy(
	done chan struct{},
	conf rescommon.ResourceConfiger,
	dur time.Duration,
) (rescommon.ResourceViewer, error)

func NewMemSimple

func NewMemSimple() (rescommon.ResourceViewer, error)

Types

type CPUOSLazy

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

func (*CPUOSLazy) Used

func (cpu *CPUOSLazy) Used() float64

type CPUOSSimple

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

func (*CPUOSSimple) Used

func (cpu *CPUOSSimple) Used() float64

type MemOSLazy

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

func (*MemOSLazy) Used

func (mem *MemOSLazy) Used() float64

type MemOSSimple

type MemOSSimple struct{}

func (*MemOSSimple) Used

func (mem *MemOSSimple) Used() float64

Jump to

Keyboard shortcuts

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