diskio

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCLKTCK

func GetCLKTCK() uint32

GetCLKTCK emulates the _SC_CLK_TCK syscall

func IOCounters

func IOCounters(names ...string) (map[string]disk.IOCountersStat, error)

IOCounters should map functionality to disk package for linux os.

Types

type IOMetric

type IOMetric struct {
	ReadRequestMergeCountPerSec  float64 `json:"rrqmCps"`
	WriteRequestMergeCountPerSec float64 `json:"wrqmCps"`
	ReadRequestCountPerSec       float64 `json:"rrqCps"`
	WriteRequestCountPerSec      float64 `json:"wrqCps"`
	// using bytes instead of sector
	ReadBytesPerSec   float64 `json:"rBps"`
	WriteBytesPerSec  float64 `json:"wBps"`
	AvgRequestSize    float64 `json:"avgrqSz"`
	AvgQueueSize      float64 `json:"avgquSz"`
	AvgAwaitTime      float64 `json:"await"`
	AvgReadAwaitTime  float64 `json:"r_await"`
	AvgWriteAwaitTime float64 `json:"w_await"`
	AvgServiceTime    float64 `json:"svctm"`
	BusyPct           float64 `json:"busy"`
}

IOMetric contains mapping fields which are outputted by `iostat -x` on linux

Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await r_await w_await svctm %util sda 0.06 0.78 0.09 0.27 9.42 8.06 48.64 0.00 1.34 0.99 1.45 0.77 0.03

type IOStat

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

IOStat carries disk statistics for all devices

func NewDiskIOStat

func NewDiskIOStat() *IOStat

NewDiskIOStat :init DiskIOStat object.

func (*IOStat) CalcIOStatistics

func (stat *IOStat) CalcIOStatistics(counter disk.IOCountersStat) (IOMetric, error)

CalcIOStatistics calculates IO statistics.

func (*IOStat) CloseSampling

func (stat *IOStat) CloseSampling()

CloseSampling closes the disk sampler

func (*IOStat) OpenSampling

func (stat *IOStat) OpenSampling() error

OpenSampling creates current cpu sampling need call as soon as get IOCounters.

Jump to

Keyboard shortcuts

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