collector

package
v0.0.0-...-ddcacec Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Average

func Average(values ...float64) float64

Average implements the average mathematical function over a slice of float64

func Maximum

func Maximum(values ...float64) float64

Maximum implements the absolute maximum mathematical function over a slice of float64

func Minimum

func Minimum(values ...float64) float64

Minimum implements the absolute minimum mathematical function over a slice of float64

func Sum

func Sum(values ...float64) float64

Sum implements the summation mathematical function over a slice of float64

Types

type AggregatorFunc

type AggregatorFunc func(...float64) float64

func ParseAggregator

func ParseAggregator(aggregator string) (AggregatorFunc, error)

reduce will reduce a slice of numbers given a aggregator function's name. If it's empty or not recognized, an error is returned.

type CollectedMetric

type CollectedMetric struct {
	Type     autoscalingv2.MetricSourceType
	External external_metrics.ExternalMetricValue
}

type Collector

type Collector interface {
	GetMetrics() ([]CollectedMetric, error)
	Interval() time.Duration
}

type CollectorFactory

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

func NewCollectorFactory

func NewCollectorFactory() *CollectorFactory

func (*CollectorFactory) NewCollector

func (c *CollectorFactory) NewCollector(hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (Collector, error)

func (*CollectorFactory) RegisterExternalCollector

func (c *CollectorFactory) RegisterExternalCollector(metrics []string, plugin CollectorPlugin)

type CollectorPlugin

type CollectorPlugin interface {
	NewCollector(hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (Collector, error)
}

type MetricConfig

type MetricConfig struct {
	MetricTypeName
	CollectorName string
	Config        map[string]string
	PerReplica    bool
	Interval      time.Duration
	MetricSpec    autoscalingv2.MetricSpec
}

func Parse

Parse parses the HPA object into a list of metric configurations.

type MetricTypeName

type MetricTypeName struct {
	Type   autoscalingv2.MetricSourceType
	Metric autoscalingv2.MetricIdentifier
}

type PluginNotFoundError

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

func (*PluginNotFoundError) Error

func (p *PluginNotFoundError) Error() string

Jump to

Keyboard shortcuts

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