resource

package
v1.2.0-origin Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package resource contains the Mesos scheduler specific resource functions

Index

Constants

View Source
const (
	DefaultDefaultContainerCPULimit = CPUShares(0.25) // CPUs allocated for pods without CPU limit
	DefaultDefaultContainerMemLimit = MegaBytes(64.0) // memory allocated for pods without memory limit
	MinimumContainerCPU             = CPUShares(0.01) // minimum CPUs allowed by Mesos
	MinimumContainerMem             = MegaBytes(32.0) // minimum memory allowed by Mesos
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUShares

type CPUShares float64

func LimitPodCPU

func LimitPodCPU(pod *api.Pod, defaultLimit CPUShares) (request, limit CPUShares, modified bool, err error)

LimitPodCPU sets default CPU requests and limits of each container that does not limit its CPU resource yet. LimitPodCPU returns the new request, limit and whether the pod was modified.

func LimitedCPUForPod

func LimitedCPUForPod(pod *api.Pod, defaultLimit CPUShares) (request, limit CPUShares, modified bool, err error)

LimitedCPUForPod computes the limits from the spec plus the default CPU limit difference for unlimited containers

func NewCPUShares

func NewCPUShares(q resource.Quantity) CPUShares

func (CPUShares) Quantity

func (f CPUShares) Quantity() *resource.Quantity

func (*CPUShares) Set

func (f *CPUShares) Set(s string) error

func (CPUShares) String

func (f CPUShares) String() string

func (CPUShares) Type

func (f CPUShares) Type() string

type MegaBytes

type MegaBytes float64

func LimitPodMem

func LimitPodMem(pod *api.Pod, defaultLimit MegaBytes) (request, limit MegaBytes, modified bool, err error)

LimitPodMem sets default memory requests and limits of each container that does not limit its memory resource yet. LimitPodMem returns the new request, limit and whether the pod was modified.

func LimitedMemForPod

func LimitedMemForPod(pod *api.Pod, defaultLimit MegaBytes) (request, limit MegaBytes, modified bool, err error)

LimitedMemForPod computes the limits from the spec plus the default memory limit difference for unlimited containers

func NewMegaBytes

func NewMegaBytes(q resource.Quantity) MegaBytes

func (MegaBytes) Quantity

func (f MegaBytes) Quantity() *resource.Quantity

func (*MegaBytes) Set

func (f *MegaBytes) Set(s string) error

func (MegaBytes) String

func (f MegaBytes) String() string

func (MegaBytes) Type

func (f MegaBytes) Type() string

Jump to

Keyboard shortcuts

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