Documentation ¶
Index ¶
- func Average(values ...float64) float64
- func Maximum(values ...float64) float64
- func Minimum(values ...float64) float64
- func Sum(values ...float64) float64
- type AggregatorFunc
- type CollectedMetric
- type Collector
- type CollectorFactory
- type CollectorPlugin
- type MetricConfig
- type MetricTypeName
- type PluginNotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Maximum ¶
Maximum implements the absolute maximum mathematical function over a slice of float64
Types ¶
type AggregatorFunc ¶
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 ¶
func Parse(hpa *autoscalingv2.HorizontalPodAutoscaler) ([]*MetricConfig, error)
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
Click to show internal directories.
Click to hide internal directories.