dutpool

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resize

func Resize(duts []*inventory.DeviceUnderTest, targetPool string, targetSize int, sparePool string) ([]*fleet.PoolChange, error)

Resize returns the inventory changes required to resize the targetPool to be of targetSize, using sparePool to borrow / return DUTs.

Types

type Balancer

type Balancer struct {
	Target map[string]fleet.Health
	Spare  map[string]fleet.Health
	// contains filtered or unexported fields
}

Balancer encapsulates the pool balancing algorithm.

Use EnsureTargetHealthy() to execute the pool balancing algorithm on an initialized Balancer.

func NewBalancer

func NewBalancer(duts []*inventory.DeviceUnderTest, target, spare string) (*Balancer, error)

NewBalancer returns an initialized Balancer.

func (*Balancer) EnsureTargetHealthy

func (pb *Balancer) EnsureTargetHealthy(maxUnhealthyDUTs int) ([]*fleet.PoolChange, []fleet.EnsurePoolHealthyResponse_Failure)

EnsureTargetHealthy balances the pools so that target pool has healthy DUTs.

This function returns the recommended changes and also any failures encountered. This function also applies the recommended changes to the Balancer state.

func (*Balancer) FillInHealth

func (pb *Balancer) FillInHealth(botsHealth map[string]fleet.Health)

FillInHealth fills in the health info for each DUT.

func (*Balancer) SpareHealthyCount

func (pb *Balancer) SpareHealthyCount() int

SpareHealthyCount counts the number of healthy DUTs in the spare pool.

func (*Balancer) TargetHealthyCount

func (pb *Balancer) TargetHealthyCount() int

TargetHealthyCount counts the number of healthy DUTs in the target pool.

Jump to

Keyboard shortcuts

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