sokar

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PathHealth is the url path for health end-point
	PathHealth = "/health"

	// PathMetrics path for the metrics end-point
	PathMetrics = "/metrics"

	// PathAlertmanager path for receiving alerts from the alertmanager
	PathAlertmanager = "/api/alerts"

	// PathScaleByPercentage is the scale-by end-point that allows scaling by percentage
	PathScaleByPercentage = "/api/scale-by/p" + "/:" + PathPartValue

	// PathScaleByValue is the scale-by end-point that allows scaling by value
	PathScaleByValue = "/api/scale-by/v" + "/:" + PathPartValue

	// PathPartValue represents a path part that takes a value
	PathPartValue = "value"

	// PathBuildInfo specifies the path where to get the build information about sokar
	PathBuildInfo = "/api/build"

	// PathConfig specifies the path where to get the config information used by sokar
	PathConfig = "/api/config"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger zerolog.Logger

	DryRunMode bool
}

Config cfg for sokar

func (*Config) New

func (cfg *Config) New(scaleEventEmitter sokarIF.ScaleEventEmitter, capacityPlanner sokarIF.CapacityPlanner, scaler sokarIF.Scaler, schedule sokarIF.ScaleSchedule, metrics Metrics) (*Sokar, error)

New creates a new instance of sokar

type Metrics

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

Metrics represents the collection of metrics internally set by sokar.

func NewMetrics

func NewMetrics() Metrics

NewMetrics returns the metrics collection needed for the SAA.

type Sokar

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

Sokar component that can be used to scale scaling-objects (jobs /instances).

func (*Sokar) GetName

func (sk *Sokar) GetName() string

GetName returns the name of this component

func (*Sokar) Health

func (sk *Sokar) Health(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

Health represents the health end-point of sokar

func (*Sokar) Join

func (sk *Sokar) Join()

Join blocks/ waits until sokar has been stopped

func (*Sokar) Run

func (sk *Sokar) Run()

Run starts sokar

func (*Sokar) ScaleByPercentage

func (sk *Sokar) ScaleByPercentage(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ScaleByPercentage is the end-point for receiving scale-by events. These are events for a relative scaling of the scaling-object. In this case the scaling is made basend on the given percentage value

func (*Sokar) ScaleByValue

func (sk *Sokar) ScaleByValue(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ScaleByValue is the end-point for receiving scale-by events. These are events for a relative scaling of the scaling-object. In this case the scaling is made basend on the given value.

func (*Sokar) Stop

func (sk *Sokar) Stop() error

Stop tears down sokar

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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