disk

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskIOStats

type DiskIOStats struct {
	Name    string `json:"name"`    // device name; like "hda"
	Readed  uint64 `json:"readed"`  // total number of reads completed successfully
	Written uint64 `json:"written"` // total number of writes completed successfully
}

DiskIOStats represents disk I/O statistics

func (*DiskIOStats) String

func (ds *DiskIOStats) String() string

func (*DiskIOStats) Subtract

func (ds *DiskIOStats) Subtract(s *DiskIOStats)

type DiskIOUsage

type DiskIOUsage struct {
	DiskIOStats
	Delta time.Duration `json:"delta,omitempty"`
}

func (*DiskIOUsage) ReadSpeed

func (du *DiskIOUsage) ReadSpeed() float64

ReadSpeed get read speed bytes/second

func (*DiskIOUsage) String

func (du *DiskIOUsage) String() string

func (*DiskIOUsage) WriteSpeed

func (du *DiskIOUsage) WriteSpeed() float64

WriteSpeed get write speed bytes/second

type DiskUsage

type DiskUsage struct {
	Free      uint64 `json:"free"`      // total free bytes on file system
	Available uint64 `json:"available"` // total available bytes on file system to an unprivileged user
	Total     uint64 `json:"total"`     // total size of the file system
}

func GetDiskUsage

func GetDiskUsage(volumePath string) (du DiskUsage, err error)

GetDiskUsage returns an object holding the disk usage of volumePath or nil in case of error (invalid path, etc)

func (*DiskUsage) String

func (du *DiskUsage) String() string

func (*DiskUsage) Usage

func (du *DiskUsage) Usage() float64

Usage returns percentage of use on the file system

func (*DiskUsage) Used

func (du *DiskUsage) Used() uint64

Used returns total bytes used in file system

type DisksIOStats

type DisksIOStats []DiskIOStats

func GetDisksStats

func GetDisksStats() (DisksIOStats, error)

GetDisksStats get disk I/O statistics.

func (DisksIOStats) Subtract

func (dss DisksIOStats) Subtract(ss DisksIOStats)

type DisksIOUsage

type DisksIOUsage []DiskIOUsage

func GetDisksIOUsage

func GetDisksIOUsage(delta time.Duration) (dsu DisksIOUsage, err error)

GetDisksIOUsage get disks I/O usages between delta duration

Jump to

Keyboard shortcuts

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