entitlement

package
v0.0.0-...-ac6a2c4 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calculator

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

Calculator is responsible for calculating the entitlements for all the leaf resource pools based on the demand, free resources and share.

func NewCalculator

func NewCalculator(
	calculationPeriod time.Duration,
	parent tally.Scope,
	dispatcher *yarpc.Dispatcher,
	tree respool.Tree,
	hmApiVersion api.Version,
	useHostPool bool,
) *Calculator

NewCalculator initializes the entitlement Calculator

func (*Calculator) Start

func (c *Calculator) Start() error

Start starts the entitlement calculation in a goroutine

func (*Calculator) Stop

func (c *Calculator) Stop() error

Stop stops Entitlement process

type CapacityManager

type CapacityManager interface {
	GetCapacity(
		ctx context.Context,
	) (

		total map[string]float64,

		slack map[string]float64,
		err error,
	)
	// Return capacity of each host-pool.
	GetHostPoolCapacity(context.Context) (
		map[string]*ResourceCapacity,
		error,
	)
}

CapacityManager interface defines method to get cluster capacity.

type ResourceCapacity

type ResourceCapacity struct {
	// Physical capacity.
	Physical map[string]float64
	// Revocable capacity.
	Slack map[string]float64
}

ResourceCapacity contains total quantity of various kinds of host resources.

Jump to

Keyboard shortcuts

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