capacity

package
v0.2.2-rc7 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	KB = 1000
	MB = 1000 * KB
	GB = 1000 * MB
	TB = 1000 * GB
	PB = 1000 * TB

	KiB = 1024
	MiB = 1024 * KiB
	GiB = 1024 * MiB
	TiB = 1024 * GiB
	PiB = 1024 * TiB
)

Storage size

Variables

This section is empty.

Functions

This section is empty.

Types

type Capacity

type Capacity struct {
	CRU uint64 `json:"cru"`
	MRU uint64 `json:"mru"`
	SRU uint64 `json:"sru"`
	HRU uint64 `json:"hru"`
}

Capacity hold the amount of resource unit of a node

type Disks

type Disks struct {
	Tool        string          `json:"tool"`
	Environment string          `json:"environment"`
	Aggregator  string          `json:"aggregator"`
	Devices     []smartctl.Info `json:"devices"`
}

Disks contains the hardware information about the disk of a node

type ResourceOracle

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

ResourceOracle is the structure responsible for capacity tracking

func NewResourceOracle

func NewResourceOracle(s *stubs.StorageModuleStub) *ResourceOracle

NewResourceOracle creates a new ResourceOracle

func (*ResourceOracle) DMI

func (r *ResourceOracle) DMI() (*dmi.DMI, error)

DMI run and parse dmidecode commands

func (*ResourceOracle) Disks

func (r *ResourceOracle) Disks() (d Disks, err error)

Disks list and parse the hardware information using smartctl

func (*ResourceOracle) GetHypervisor

func (r *ResourceOracle) GetHypervisor() ([]string, error)

GetHypervisor gets the name of the hypervisor used on the node

func (*ResourceOracle) Total

func (r *ResourceOracle) Total() (c *Capacity, err error)

Total returns the total amount of resource units of the node

func (*ResourceOracle) Uptime

func (r *ResourceOracle) Uptime() (uint64, error)

Uptime returns the uptime of the node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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