backend

package
v0.0.0-...-c0ac931 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: Apache-2.0 Imports: 17 Imported by: 2

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

type InfluxDbBackend

type InfluxDbBackend struct {
	Name       string
	Config     InfluxDbConfig
	Connection influx.Client
}

InfluxDbBackend is a metrics backend

func NewInfluxDbBackend

func NewInfluxDbBackend(name string, config InfluxDbConfig) (*InfluxDbBackend, error)

NewInfluxDbBackend will create a new InfluxDB Client

func (*InfluxDbBackend) GetValue

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

GetValue gets a value

func (*InfluxDbBackend) Info

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

type InfluxDbConfig

type InfluxDbConfig struct {
	Name      string
	Kind      string
	Addr      string
	Username  string
	Password  string
	UserAgent string
	Timeout   string
}

InfluxDbConfig is the configuration for a InfluxDB backend

type PrometheusBackend

type PrometheusBackend struct {
	Name       string
	Config     PrometheusConfig
	Connection prometheus.QueryAPI
}

PrometheusBackend is a metrics backend

func NewPrometheusBackend

func NewPrometheusBackend(name string, config PrometheusConfig, queryApi prometheus.QueryAPI) (*PrometheusBackend, error)

NewPrometheusBackend will create a new Prometheus Client

func (*PrometheusBackend) GetValue

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

GetValue gets a value

func (*PrometheusBackend) Info

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

type PrometheusConfig

type PrometheusConfig struct {
	Name string
	Kind string
	Host string
}

PrometheusConfig is the configuration for a Prometheus backend

Jump to

Keyboard shortcuts

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