loadutil

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const PRO_MEM = "/proc/%d/status"

Variables

View Source
var (
	ErrInvalidDiskPartition = errors.New("invalid disk partiton")
	ErrFailedToGetIoCounter = errors.New("failed to get io counter")
)

Functions

func GetCpuUtilPercent

func GetCpuUtilPercent(sampleDuration time.Duration) (used float64, err error)

func GetCurrentProcessMemory

func GetCurrentProcessMemory() (used uint64, err error)

func GetDisksIoSample

func GetDisksIoSample(partitions []*disk.PartitionStat, duration time.Duration) (map[string]DiskIoSample, error)

func GetGoInUsedHeap

func GetGoInUsedHeap() (size uint64)

func GetGoMemStats

func GetGoMemStats() (heapInfo runtime.MemStats)

func GetIoCounter

func GetIoCounter(partition *disk.PartitionStat) (*disk.IOCountersStat, error)

func GetMatchParation

func GetMatchParation(path string) (*disk.PartitionStat, error)

func GetMemoryUsedPercent

func GetMemoryUsedPercent() (used float64, err error)

func GetTotalMemory

func GetTotalMemory() (total uint64, err error)

func GetTotalSwapMemory

func GetTotalSwapMemory() (total uint64, err error)

func GetUsedMemory

func GetUsedMemory() (used uint64, err error)

func IsEnableSwapMemory

func IsEnableSwapMemory() (enable bool, err error)

Types

type DiskIoSample

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

func GetDiskIoSample

func GetDiskIoSample(partition *disk.PartitionStat, duration time.Duration) (DiskIoSample, error)

func (*DiskIoSample) GetIoAvgWaitTime

func (sample *DiskIoSample) GetIoAvgWaitTime() time.Duration

func (*DiskIoSample) GetIoCount

func (sample *DiskIoSample) GetIoCount() uint64

func (*DiskIoSample) GetIoTotalWaitTime

func (sample *DiskIoSample) GetIoTotalWaitTime() time.Duration

func (*DiskIoSample) GetIoUtilPercent

func (sample *DiskIoSample) GetIoUtilPercent() float64

func (*DiskIoSample) GetIopsInProgress

func (sample *DiskIoSample) GetIopsInProgress() uint64

func (*DiskIoSample) GetMergedReadCount

func (sample *DiskIoSample) GetMergedReadCount() uint64

func (*DiskIoSample) GetMergedWriteCount

func (sample *DiskIoSample) GetMergedWriteCount() uint64

func (*DiskIoSample) GetPartition

func (sample *DiskIoSample) GetPartition() *disk.PartitionStat

func (*DiskIoSample) GetReadAvgWaitTime

func (sample *DiskIoSample) GetReadAvgWaitTime() time.Duration

func (*DiskIoSample) GetReadBytes

func (sample *DiskIoSample) GetReadBytes() uint64

func (*DiskIoSample) GetReadCount

func (sample *DiskIoSample) GetReadCount() uint64

func (*DiskIoSample) GetReadFlow

func (sample *DiskIoSample) GetReadFlow() uint64

func (*DiskIoSample) GetReadTotalWaitTime

func (sample *DiskIoSample) GetReadTotalWaitTime() time.Duration

func (*DiskIoSample) GetSampleDuration

func (sample *DiskIoSample) GetSampleDuration() time.Duration

func (*DiskIoSample) GetWeightedAvgWaitTime

func (sample *DiskIoSample) GetWeightedAvgWaitTime() time.Duration

func (*DiskIoSample) GetWeightedTotalWaitTime

func (sample *DiskIoSample) GetWeightedTotalWaitTime() time.Duration

func (*DiskIoSample) GetWriteAvgWaitTime

func (sample *DiskIoSample) GetWriteAvgWaitTime() time.Duration

func (*DiskIoSample) GetWriteBytes

func (sample *DiskIoSample) GetWriteBytes() uint64

func (*DiskIoSample) GetWriteCount

func (sample *DiskIoSample) GetWriteCount() uint64

func (*DiskIoSample) GetWriteFlow

func (sample *DiskIoSample) GetWriteFlow() uint64

func (*DiskIoSample) GetWriteTotalWaitTime

func (sample *DiskIoSample) GetWriteTotalWaitTime() time.Duration

type DiskIoSampleItem

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

Jump to

Keyboard shortcuts

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