fs

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Provides Filesystem Stats

Index

Constants

View Source
const (
	LabelSystemRoot   = "root"
	LabelDockerImages = "docker-images"
	LabelRktImages    = "rkt-images"
	LabelCrioImages   = "crio-images"
)

Variables

View Source
var ErrNoSuchDevice = errors.New("cadvisor: no such device")

ErrNoSuchDevice is the error indicating the requested device does not exist.

Functions

func GetDirDiskUsage

func GetDirDiskUsage(dir string, timeout time.Duration) (uint64, error)

func GetDirInodeUsage

func GetDirInodeUsage(dir string, timeout time.Duration) (uint64, error)

Types

type Context

type Context struct {
	// docker root directory.
	Docker  DockerContext
	RktPath string
	Crio    CrioContext
}

type CrioContext

type CrioContext struct {
	Root string
}

type DeviceInfo

type DeviceInfo struct {
	Device string
	Major  uint
	Minor  uint
}

type DiskStats

type DiskStats struct {
	ReadsCompleted  uint64
	ReadsMerged     uint64
	SectorsRead     uint64
	ReadTime        uint64
	WritesCompleted uint64
	WritesMerged    uint64
	SectorsWritten  uint64
	WriteTime       uint64
	IoInProgress    uint64
	IoTime          uint64
	WeightedIoTime  uint64
}

type DockerContext

type DockerContext struct {
	Root         string
	Driver       string
	DriverStatus map[string]string
}

type Fs

type Fs struct {
	DeviceInfo
	Type       FsType
	Capacity   uint64
	Free       uint64
	Available  uint64
	Inodes     *uint64
	InodesFree *uint64
	DiskStats  DiskStats
}

type FsInfo

type FsInfo interface {
	// Returns capacity and free space, in bytes, of all the ext2, ext3, ext4 filesystems on the host.
	GetGlobalFsInfo() ([]Fs, error)

	// Returns capacity and free space, in bytes, of the set of mounts passed.
	GetFsInfoForPath(mountSet map[string]struct{}) ([]Fs, error)

	// Returns number of bytes occupied by 'dir'.
	GetDirDiskUsage(dir string, timeout time.Duration) (uint64, error)

	// Returns number of inodes used by 'dir'.
	GetDirInodeUsage(dir string, timeout time.Duration) (uint64, error)

	// GetDeviceInfoByFsUUID returns the information of the device with the
	// specified filesystem uuid. If no such device exists, this function will
	// return the ErrNoSuchDevice error.
	GetDeviceInfoByFsUUID(uuid string) (*DeviceInfo, error)

	// Returns the block device info of the filesystem on which 'dir' resides.
	GetDirFsDevice(dir string) (*DeviceInfo, error)

	// Returns the device name associated with a particular label.
	GetDeviceForLabel(label string) (string, error)

	// Returns all labels associated with a particular device name.
	GetLabelsForDevice(device string) ([]string, error)

	// Returns the mountpoint associated with a particular device.
	GetMountpointForDevice(device string) (string, error)
}

func NewFsInfo

func NewFsInfo(context Context) (FsInfo, error)

type FsType

type FsType string
const (
	ZFS          FsType = "zfs"
	DeviceMapper FsType = "devicemapper"
	VFS          FsType = "vfs"
)

func (FsType) String

func (ft FsType) String() string

type RealFsInfo

type RealFsInfo struct {
	// contains filtered or unexported fields
}

func (*RealFsInfo) GetDeviceForLabel

func (self *RealFsInfo) GetDeviceForLabel(label string) (string, error)

func (*RealFsInfo) GetDeviceInfoByFsUUID

func (self *RealFsInfo) GetDeviceInfoByFsUUID(uuid string) (*DeviceInfo, error)

func (*RealFsInfo) GetDirDiskUsage

func (self *RealFsInfo) GetDirDiskUsage(dir string, timeout time.Duration) (uint64, error)

func (*RealFsInfo) GetDirFsDevice

func (self *RealFsInfo) GetDirFsDevice(dir string) (*DeviceInfo, error)

func (*RealFsInfo) GetDirInodeUsage

func (self *RealFsInfo) GetDirInodeUsage(dir string, timeout time.Duration) (uint64, error)

func (*RealFsInfo) GetFsInfoForPath

func (self *RealFsInfo) GetFsInfoForPath(mountSet map[string]struct{}) ([]Fs, error)

func (*RealFsInfo) GetGlobalFsInfo

func (self *RealFsInfo) GetGlobalFsInfo() ([]Fs, error)

func (*RealFsInfo) GetLabelsForDevice

func (self *RealFsInfo) GetLabelsForDevice(device string) ([]string, error)

func (*RealFsInfo) GetMountpointForDevice

func (self *RealFsInfo) GetMountpointForDevice(dev string) (string, error)

Jump to

Keyboard shortcuts

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