Documentation ¶
Index ¶
- func AlignedBlock(blockSize int) []byte
- func DisableDirectIO(f *os.File) error
- func FadviseDontNeed(f *os.File) error
- func Fdatasync(f *os.File) error
- func IsRootDisk(diskPath string, rootDisk string) (bool, error)
- func OpenFileDirectIO(filePath string, flag int, perm os.FileMode) (*os.File, error)
- func SameDisk(disk1, disk2 string) (bool, error)
- type AllDrivesIOStats
- type DevID
- type IOStats
- type Info
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlignedBlock ¶
AlignedBlock - pass through to directio implementation.
func DisableDirectIO ¶
DisableDirectIO - disables directio mode.
func FadviseDontNeed ¶
FadviseDontNeed invalidates page-cache
func Fdatasync ¶
The aim of fdatasync() is to reduce disk activity for applications that do not require all metadata to be synchronized with the disk.
func IsRootDisk ¶
IsRootDisk returns if diskPath belongs to root-disk, i.e the disk mounted at "/"
func OpenFileDirectIO ¶
OpenFileDirectIO - bypass kernel cache.
Types ¶
type AllDrivesIOStats ¶
AllDrivesIOStats is map between drive devices and IO stats
func GetAllDrivesIOStats ¶
func GetAllDrivesIOStats() (info AllDrivesIOStats, err error)
GetAllDrivesIOStats returns IO stats of all drives found in the machine
type IOStats ¶
type IOStats struct { ReadIOs uint64 ReadMerges uint64 ReadSectors uint64 ReadTicks uint64 WriteIOs uint64 WriteMerges uint64 WriteSectors uint64 WriteTicks uint64 CurrentIOs uint64 TotalTicks uint64 ReqTicks uint64 DiscardIOs uint64 DiscardMerges uint64 DiscardSectors uint64 DiscardTicks uint64 FlushIOs uint64 FlushTicks uint64 }
IOStats contains stats of a single drive
type Info ¶
type Info struct { Total uint64 Free uint64 Used uint64 Files uint64 Ffree uint64 FSType string Major uint32 Minor uint32 }
Info stat fs struct is container which holds following values Total - total size of the volume / disk Free - free size of the volume / disk Files - total inodes available Ffree - free inodes available FSType - file system type