diskio

package
v6.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package diskio fetches disk IO metrics from the OS. It is implemented for darwin (requires cgo), freebsd, linux, and windows.

Detailed descriptions of IO stats provided by Linux can be found here: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/iostats.txt?id=refs/tags/v4.6-rc7

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get_CLK_TCK added in v6.1.0

func Get_CLK_TCK() uint32

func New

func New(base mb.BaseMetricSet) (mb.MetricSet, error)

New is a mb.MetricSetFactory that returns a new MetricSet.

Types

type DiskIOMetric added in v6.1.0

type DiskIOMetric 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"`
	AvgServiceTime   float64 `json:"svctm"`
	BusyPct          float64 `json:"busy"`
}

mapping fields which output 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 DiskIOStat added in v6.1.0

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

func NewDiskIOStat added in v6.1.0

func NewDiskIOStat() *DiskIOStat

func (*DiskIOStat) CalIOStatistics added in v6.1.0

func (stat *DiskIOStat) CalIOStatistics(counter disk.IOCountersStat) (DiskIOMetric, error)

func (*DiskIOStat) CloseSampling added in v6.1.0

func (stat *DiskIOStat) CloseSampling()

func (*DiskIOStat) OpenSampling added in v6.1.0

func (stat *DiskIOStat) OpenSampling() error

create current cpu sampling need call as soon as get IOCounters

type MetricSet

type MetricSet struct {
	mb.BaseMetricSet
	// contains filtered or unexported fields
}

MetricSet for fetching system disk IO metrics.

func (*MetricSet) Fetch

func (m *MetricSet) Fetch() ([]common.MapStr, error)

Fetch fetches disk IO metrics from the OS.

Jump to

Keyboard shortcuts

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