ios

package
v1.3.15 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: MIT Imports: 19 Imported by: 6

Documentation

Overview

Package ios is a collection of interfaces to the local storage subsystem; the package includes OS-dependent implementations for those interfaces.

  • Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.

Package ios is a collection of interfaces to the local storage subsystem; the package includes OS-dependent implementations for those interfaces.

  • Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.

Package ios is a collection of interfaces to the local storage subsystem; the package includes OS-dependent implementations for those interfaces.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package ios is a collection of interfaces to the local storage subsystem; the package includes OS-dependent implementations for those interfaces.

  • Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.

Package ios is a collection of interfaces to the local storage subsystem; the package includes OS-dependent implementations for those interfaces.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package ios is a collection of interfaces to the local storage subsystem; the package includes OS-dependent implementations for those interfaces.

  • Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.

Package ios is a collection of interfaces to the local storage subsystem; the package includes OS-dependent implementations for those interfaces.

  • Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirFileCount

func DirFileCount(dirPath string) (int, error)

func DirSizeOnDisk

func DirSizeOnDisk(dirPath string) (uint64, error)

- on-disk size is sometimes referred to as "apparent size" - ignore errors since `du` exits with status 1 if it encounters a file that couldn't be accessed (permissions)

func DirSumFileSizes

func DirSumFileSizes(dirPath string) (uint64, error)

func FinfoAtime

func FinfoAtime(fqn string) (finfo os.FileInfo, atime int64, err error)

func GetATime

func GetATime(osfi os.FileInfo) time.Time

func GetFSStats

func GetFSStats(path string) (blocks, bavail uint64, bsize int64, err error)

func GetFSUsedPercentage

func GetFSUsedPercentage(path string) (usedPercentage int64, ok bool)

Types

type AllDiskStats

type AllDiskStats map[string]DiskStats

type BlockDevice

type BlockDevice struct {
	Name         string          `json:"name"`
	PhySec       jsoniter.Number `json:"phy-sec"`
	BlockDevices []*BlockDevice  `json:"children"`
}

`lsblk -Jt` structure

type DiskStats

type DiskStats struct{ RBps, Ravg, WBps, Wavg, Util int64 }

type FsDisks

type FsDisks map[string]int64 // disk name => sector size

type IOStater

type IOStater interface {
	GetAllMpathUtils() *MpathUtil
	GetMpathUtil(mpath string) int64
	AddMpath(mpath string, fs string) (FsDisks, error)
	RemoveMpath(mpath string)
	FillDiskStats(m AllDiskStats)
}

func New

func New() IOStater

type LsBlk

type LsBlk struct {
	BlockDevices []*BlockDevice `json:"blockdevices"`
}

type MpathUtil

type MpathUtil sync.Map

func (*MpathUtil) Get

func (x *MpathUtil) Get(mpath string) int64

func (*MpathUtil) Set

func (x *MpathUtil) Set(mpath string, util int64)

Jump to

Keyboard shortcuts

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