backend

package
v0.0.0-...-29e28e0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Work

func Work(r *structs.Rule, nomadConf *nomad.Config, job, group string, min, max int) error

Work actually does the autoscaling for a rule

Types

type CloudWatchBackend

type CloudWatchBackend struct {
	Name       string
	Config     CloudWatchConfig
	Connection *cloudwatch.CloudWatch
}

CloudWatchBackend is a metrics backend

func NewCloudWatchBackend

func NewCloudWatchBackend(name string, config CloudWatchConfig) (*CloudWatchBackend, error)

NewCloudWatchBackend will create a new CloudWatch Client

func (*CloudWatchBackend) GetValue

func (b *CloudWatchBackend) GetValue(rule structs.Rule) (float64, error)

GetValue gets a value

func (*CloudWatchBackend) Info

func (b *CloudWatchBackend) Info() *structs.Backend

type CloudWatchConfig

type CloudWatchConfig struct {
	Name   string
	Kind   string
	Region string
}

CloudWatchConfig is the configuration for a CloudWatch backend

type ConfiguredBackends

type ConfiguredBackends map[string]structs.Backender

ConfiguredBackends struct

func InitializeBackends

func InitializeBackends(backends map[string]structs.Backend) (ConfiguredBackends, error)

InitializeBackends loads valid backends into a map

type GraphiteBackend

type GraphiteBackend struct {
	Name       string
	Config     GraphiteConfig
	Connection *graphite.Client
}

GraphiteBackend is a metrics backend

func NewGraphiteBackend

func NewGraphiteBackend(name string, config GraphiteConfig) (*GraphiteBackend, error)

NewGraphiteBackend will create a new Graphite Client

func (*GraphiteBackend) GetValue

func (b *GraphiteBackend) GetValue(rule structs.Rule) (float64, error)

GetValue gets a value

func (*GraphiteBackend) Info

func (b *GraphiteBackend) Info() *structs.Backend

type GraphiteConfig

type GraphiteConfig struct {
	Name     string
	Kind     string
	Host     string
	Username string
	Password string
}

GraphiteConfig is the configuration for a Graphite backend

Jump to

Keyboard shortcuts

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