Documentation ¶
Overview ¶
Package diskstat implements metrics collection related to disk IO usage
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiskStat ¶
type DiskStat struct { Disks map[string]*PerDiskStat // contains filtered or unexported fields }
DiskStat represents statistics collected for all disks (block devices) present on the current operating system.
func New ¶
func New(m *metrics.MetricContext, Step time.Duration) *DiskStat
New registers statistics with metrics context and starts collection of metrics every Step seconds
func (*DiskStat) ByUsage ¶
func (s *DiskStat) ByUsage() []*PerDiskStat
ByUsage returns an slice of *PerDiskStat entries sorted by usage
func (*DiskStat) Collect ¶
func (s *DiskStat) Collect()
Collect walks through /proc/diskstats and updates relevant metrics
func (*DiskStat) RefreshBlkDevList ¶
func (s *DiskStat) RefreshBlkDevList()
RefreshBlkDevList walks through /sys/block and updates list of block devices.
type PerDiskStat ¶
type PerDiskStat struct { ReadCompleted *metrics.Counter ReadMerged *metrics.Counter ReadSectors *metrics.Counter ReadSpentMsecs *metrics.Counter WriteCompleted *metrics.Counter WriteMerged *metrics.Counter WriteSectors *metrics.Counter WriteSpentMsecs *metrics.Counter IOInProgress *metrics.Gauge IOSpentMsecs *metrics.Counter WeightedIOSpentMsecs *metrics.Counter SectorSize *metrics.Gauge Name string // contains filtered or unexported fields }
PerDiskStat represents disk statistics for a particular disk
func NewPerDiskStat ¶
func NewPerDiskStat(m *metrics.MetricContext, blkdev string) *PerDiskStat
NewPerDiskStat registers with metriccontext for a particular disk (block device)
func (*PerDiskStat) Usage ¶
func (s *PerDiskStat) Usage() float64
Usage returns approximate measure of disk usage (time spent doing IO / wall clock time)