Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scaling ¶
type Scaling struct {
// contains filtered or unexported fields
}
func NewScaling ¶
func NewScaling(state State, url string, opts ...ScalingOption) (*Scaling, error)
func NewScalingWithOptions ¶
func NewScalingWithOptions(state State, sMetrics ScalingMetrics, receive ScalingReceiver, calculate ScalingCalculator, prepare ScalingPreparator, url string, opts ...ScalingOption) (*Scaling, error)
func (*Scaling) ProcessScrapeTargetWithValue ¶
func (s *Scaling) ProcessScrapeTargetWithValue(scrapeTarget *cloudburst.ScrapeTarget, value float64) error
type ScalingCalculator ¶
type ScalingCalculator interface {
Calculate(scrapeTarget *cloudburst.ScrapeTarget, instances []*cloudburst.Instance, metricValue float64) cloudburst.ScalingResult
}
type ScalingMetrics ¶
type ScalingOption ¶
ScalingOption passed to NewBot to change the default instance.
func WithCalculator ¶
func WithCalculator(c ScalingCalculator) ScalingOption
func WithInterval ¶
func WithInterval(t time.Duration) ScalingOption
func WithLogger ¶
func WithLogger(l log.Logger) ScalingOption
func WithMetrics ¶
func WithMetrics(m ScalingMetrics) ScalingOption
func WithReceiver ¶
func WithReceiver(r ScalingReceiver) ScalingOption
type ScalingPreparator ¶
type ScalingPreparator interface {
Prepare(result cloudburst.ScalingResult, scrapeTarget *cloudburst.ScrapeTarget) error
}
type ScalingReceiver ¶
type State ¶
type State interface { ListScrapeTargets() ([]*cloudburst.ScrapeTarget, error) GetInstance(scrapeTarget string, name string) (*cloudburst.Instance, error) GetInstances(scrapeTarget string) ([]*cloudburst.Instance, error) RemoveInstances(scrapeTarget string, instances []*cloudburst.Instance) error RemoveInstance(scrapeTarget string, instance *cloudburst.Instance) error SaveInstances(scrapeTarget string, instances []*cloudburst.Instance) ([]*cloudburst.Instance, error) SaveInstance(scrapeTarget string, instance *cloudburst.Instance) (*cloudburst.Instance, error) }
Click to show internal directories.
Click to hide internal directories.