diskutil

package
v0.0.0-...-f673fef Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OrderedBy

func OrderedBy(less ...lessFunc) *multiSorter

OrderedBy returns a Sorter that sorts using the less functions, in order. Call its Sort method to sort the data.

func PrintUsageStats

func PrintUsageStats() error

PrintUsageStats prints the DiskStat usage stats

func ReadTop

func ReadTop() error

func Top

func Top(ps []*ProcessIOStat, res string) error

Top will return top result for RAM and CPU

func WriteTop

func WriteTop() error

Types

type DiskStat

type DiskStat struct {
	Device            string
	Mountpoint        string
	Fstype            string
	Total             uint64
	Free              uint64
	Used              uint64
	UsedPercent       float64
	InodesTotal       uint64
	InodesUsed        uint64
	InodesFree        uint64
	InodesUsedPercent float64
}

DiskStat represents a physical disk and it's respective info

func GetDiskStats

func GetDiskStats() ([]*DiskStat, error)

GetDiskStats returns slice of DiskStat with the partition and usage info

func GetPartitions

func GetPartitions() ([]*DiskStat, error)

GetPartitions returns slice of DiskStat with the partition info

func (*DiskStat) GetUsageStat

func (dstat *DiskStat) GetUsageStat() error

GetUsageStat returns slice of DiskStat with the usage info

type ProcessIOStat

type ProcessIOStat struct {
	Name         string
	Pid          int
	Readchar     int64
	Writechar    int64
	SyscallRead  int64
	SyscallWrite int64
	ReadBytes    int64
	WriteBytes   int64
}

ProcessIOStat represents the IO stats of a process

Jump to

Keyboard shortcuts

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