entitlement

package
v0.0.0-...-c0686e8 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 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