resource

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2014 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TODO(jonboulle): make these configurable
	HostCores  = 100
	HostMemory = 256
	HostDisk   = 0
)

Variables

HostResources represents a set of resources that fleet considers reserved for the host, i.e. outside of any units it is running

Functions

This section is empty.

Types

type ResourceTuple

type ResourceTuple struct {
	// in hundreds, ie 100=1core, 50=0.5core, 200=2cores, etc
	Cores int
	// in MB
	Memory int
	// in MB
	Disk int
}

ResourceTuple groups together CPU, memory and disk space. This could be total, available or consumed. It could also be used by job resource requirements.

func Sub added in v0.5.4

func Sub(r1, r2 ResourceTuple) (res ResourceTuple)

Sub returns a ResourceTuple representing the difference between two ResourceTuples

func Sum added in v0.5.4

func Sum(resources ...ResourceTuple) (res ResourceTuple)

Sum aggregates a number of ResourceTuples into a single entity

func (ResourceTuple) Empty added in v0.5.4

func (rt ResourceTuple) Empty() bool

Empty returns true if all components of the ResourceTuple are zero.

Jump to

Keyboard shortcuts

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