ios

package
v1.3.16 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: MIT Imports: 19 Imported by: 2

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-2023, 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.

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-2023, 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, withNonDirPrefix bool) (uint64, error)

- on-disk size is sometimes referred to as "apparent size" - NOTE: ignore exec error: `du` exits with status 1 if encounters non-regular file that can't be accessed (perm) - `withNonDirPrefix` is allowed to match nothing

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

public

type IOS added in v1.3.16

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

public

func New

func New(num int) IOS

type LsBlk

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

type MpathUtil

type MpathUtil sync.Map

public

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