diskstat

package
v0.0.0-...-4714720 Latest Latest
Warning

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

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

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

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)

Jump to

Keyboard shortcuts

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