disk

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlkInfo

func BlkInfo(di *DiskInfo)

func Stats

func Stats(di *DiskInfo)

func Storage

func Storage(di *DiskInfo)

Types

type Context

type Context struct {
	Procfs string
}
var Ctx Context

type DiskInfo

type DiskInfo struct {
	Storage    []StorageInfo   // 每一个分区存储为一个 storage
	Partitions []PartitionStat // 按分区统计
}

disk stats

func AllInfo

func AllInfo() DiskInfo

type PartitionStat

type PartitionStat struct {
	MajorNum int    // device id, 此块设备的主设备号
	MinorNum int    // partition id, 此块设备的次设备号
	Name     string // device name, 此块设备名字

	ReadsCompleted uint64 // 成功完成的读请求次数
	ReadsMerged    uint64 // 读请求的次数
	SectorsRead    uint64 // 读请求的扇区数总和
	ReadTime       uint64 // 读请求花费的时间总和

	WritesCompleted uint64 // 成功完成的写请求次数
	WritesMerged    uint64 // 写请求合并的次数
	SectorsWrite    uint64 // 写请求的扇区数总和
	WriteTime       uint64 // 写请求花费的时间总和

	QueueIOs       uint64 // 次块设备队列中的IO请求数
	IOTime         uint64 // 块设备队列非空时间总和
	IOWeightedTime uint64 // 块设备队列非空时间加权读请求的扇区数总和总和

	PhySector uint64 // 物理 sector 大小, 默认为 0,通过 BlkInfo() 修正
	LogSector uint64 // 逻辑 sector 大小, 默认为 0,通过 BlkInfo() 修正
}

type StorageInfo

type StorageInfo struct {
	Fs         string
	Type       string
	Size       string
	Used       string
	Avail      string
	UsePercent string
	MountPoint string
}

存储状态

Jump to

Keyboard shortcuts

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