machine

package
v0.0.0-...-334364b Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLocalMachineID

func IsLocalMachineID(mID string) bool

IsLocalMachineID returns whether the given machine ID is equal to that of the local machine

Types

type DiskUsage

type DiskUsage struct {
	Mount     string
	TotalSize uint64
	UsedSize  uint64
}

type Loadavg

type Loadavg struct {
	Avg1min  float64
	Avg5min  float64
	Avg15min float64
}

type Machine

type Machine interface {
	ID() string
	ShortID() string
	MatchID(ID string) bool
	Status() *MachineStatus
	Monitor(<-chan struct{})
}

func NewMachineFromConfig

func NewMachineFromConfig(cfg *config.Config) (Machine, error)

type MachineInfo

type MachineInfo struct {
	HostName   string
	HostRegion string
	HostIDC    string
	PublicIP   string
}

type MachineStat

type MachineStat struct {
	UsageOfCPU  float64
	TotalMem    uint64
	UsedMem     uint64
	TotalSwp    uint64
	UsedSwp     uint64
	LoadAvg     []float64
	UsageOfDisk []DiskUsage
	ClockOffset float64
}

type MachineStatus

type MachineStatus struct {
	MachID   string
	IsAlive  bool
	MachInfo MachineInfo
	MachStat MachineStat
}

type Mem

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

Jump to

Keyboard shortcuts

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