Documentation ¶
Index ¶
- Constants
- Variables
- func GetCpuUtilPercent(sampleDuration time.Duration) (used float64, err error)
- func GetCurrentProcessMemory() (used uint64, err error)
- func GetDisksIoSample(partitions []*disk.PartitionStat, duration time.Duration) (map[string]DiskIoSample, error)
- func GetGoInUsedHeap() (size uint64)
- func GetGoMemStats() (heapInfo runtime.MemStats)
- func GetIoCounter(partition *disk.PartitionStat) (*disk.IOCountersStat, error)
- func GetMatchParation(path string) (*disk.PartitionStat, error)
- func GetMemoryUsedPercent() (used float64, err error)
- func GetTotalMemory() (total uint64, err error)
- func GetTotalSwapMemory() (total uint64, err error)
- func GetUsedMemory() (used uint64, err error)
- func IsEnableSwapMemory() (enable bool, err error)
- type DiskIoSample
- func (sample *DiskIoSample) GetIoAvgWaitTime() time.Duration
- func (sample *DiskIoSample) GetIoCount() uint64
- func (sample *DiskIoSample) GetIoTotalWaitTime() time.Duration
- func (sample *DiskIoSample) GetIoUtilPercent() float64
- func (sample *DiskIoSample) GetIopsInProgress() uint64
- func (sample *DiskIoSample) GetMergedReadCount() uint64
- func (sample *DiskIoSample) GetMergedWriteCount() uint64
- func (sample *DiskIoSample) GetPartition() *disk.PartitionStat
- func (sample *DiskIoSample) GetReadAvgWaitTime() time.Duration
- func (sample *DiskIoSample) GetReadBytes() uint64
- func (sample *DiskIoSample) GetReadCount() uint64
- func (sample *DiskIoSample) GetReadFlow() uint64
- func (sample *DiskIoSample) GetReadTotalWaitTime() time.Duration
- func (sample *DiskIoSample) GetSampleDuration() time.Duration
- func (sample *DiskIoSample) GetWeightedAvgWaitTime() time.Duration
- func (sample *DiskIoSample) GetWeightedTotalWaitTime() time.Duration
- func (sample *DiskIoSample) GetWriteAvgWaitTime() time.Duration
- func (sample *DiskIoSample) GetWriteBytes() uint64
- func (sample *DiskIoSample) GetWriteCount() uint64
- func (sample *DiskIoSample) GetWriteFlow() uint64
- func (sample *DiskIoSample) GetWriteTotalWaitTime() time.Duration
- type DiskIoSampleItem
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 GetCurrentProcessMemory ¶
func GetDisksIoSample ¶
func GetDisksIoSample(partitions []*disk.PartitionStat, duration time.Duration) (map[string]DiskIoSample, error)
func GetGoInUsedHeap ¶
func GetGoInUsedHeap() (size uint64)
func GetGoMemStats ¶
func GetIoCounter ¶
func GetIoCounter(partition *disk.PartitionStat) (*disk.IOCountersStat, error)
func GetMatchParation ¶
func GetMatchParation(path string) (*disk.PartitionStat, error)
func GetMemoryUsedPercent ¶
func GetTotalMemory ¶
func GetTotalSwapMemory ¶
func GetUsedMemory ¶
func IsEnableSwapMemory ¶
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
}
Click to show internal directories.
Click to hide internal directories.