hostpool

package
v0.0.0-...-a69e935 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// HostnameKey is the key for indexing hostname in log message
	HostnameKey = "hostname"

	// HostPoolKey is the key for indexing host pool ID in log message
	HostPoolKey = "host_pool"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HostPool

type HostPool interface {
	// ID returns host pool id.
	ID() string

	// Hosts returns all hosts in the pool as a map from hostname to host summary.
	Hosts() map[string]struct{}

	// Add adds given host to the pool.
	Add(host string)

	// Delete deletes given host from the pool.
	Delete(host string)

	// Cleanup deletes all hosts from the pool.
	Cleanup()

	// RefreshMetrics refreshes metrics of the host pool.
	RefreshMetrics()

	// Get capacity of the pool.
	Capacity() host.ResourceCapacity

	// Recalculate host-pool capacity from given host capacities.
	RefreshCapacity(hostCapacities map[string]*host.ResourceCapacity)
}

HostPool represents a set of hosts as a virtual host pool And provides abstraction to operate a host pool.

func New

func New(id string, parentScope tally.Scope) HostPool

New returns a new hostPool instance.

type Metrics

type Metrics struct {
	TotalHosts       tally.Gauge
	PhysicalCapacity scalar.GaugeMaps
	SlackCapacity    scalar.GaugeMaps
}

Metrics contains all per-pool metrics.

func NewMetrics

func NewMetrics(scope tally.Scope, poolID string) *Metrics

NewMetrics creates Metrics for a given pool-ID.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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