capacity

package
v0.0.0-...-9dab196 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: BSD-3-Clause Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotConfig

type BotConfig struct {
	Dimensions           []string        `json:"dimensions"`
	Bots                 map[string]bool `json:"bots"` // maps bot id to boolean
	TaskAverageDurations []TaskDuration  `json:"tasks"`
}

BotConfig represents one bot config we test on. I.e. one group of dimensions that execute tasks.

type CapacityClient

type CapacityClient interface {
	// QueryAll updates the capacity metrics.
	QueryAll(ctx context.Context) error

	// StartLoading begins an infinite loop to recompute the capacity metrics after a
	// given interval of time.  Any errors are logged, but the loop is not broken.
	StartLoading(ctx context.Context, interval time.Duration)

	// Returns the most recent capacity metrics. Keyed by stringified dimensions.
	CapacityMetrics() map[string]BotConfig
}

CapacityClient provides methods for tracking bot capacity.

type CapacityClientImpl

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

func New

Caller is responsible for periodically updating the arguments.

func (*CapacityClientImpl) CapacityMetrics

func (c *CapacityClientImpl) CapacityMetrics() map[string]BotConfig

CapacityMetrics implements CapacityClient.

func (*CapacityClientImpl) QueryAll

func (c *CapacityClientImpl) QueryAll(ctx context.Context) error

QueryAll implements CapacityClient.

func (*CapacityClientImpl) StartLoading

func (c *CapacityClientImpl) StartLoading(ctx context.Context, interval time.Duration)

StartLoading implements CapacityClient.

type TaskDuration

type TaskDuration struct {
	Name            string        `json:"task_name"`
	AverageDuration time.Duration `json:"task_duration_ns"`
	OnCQ            bool          `json:"on_cq_also"`
}

Jump to

Keyboard shortcuts

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