Documentation
¶
Index ¶
- Constants
- func CheckTimeOp(op types.OperationOverTime) error
- func ClampValue(lggr logr.Logger, value float64, metadata map[string]string) float64
- func ContextWithLogger(ctx context.Context, logger logr.Logger) context.Context
- func Filter[I any](input []I, f func(I) bool) []I
- func Filter2[I any](input []I, f func(I) bool) []I
- func FlatMap[I, R any](input []I, f func(I) []R) []R
- func GetMetricQuery(lggr logr.Logger, metadata map[string]string, mp types.Parser) (types.MetricName, types.Labels, types.AggregationOverVectors, error)
- func GetOperationOvertTime(lggr logr.Logger, metadata map[string]string) types.OperationOverTime
- func GetTargetValue(metadata map[string]string) (int64, error)
- func IsDebug(lvl zapcore.LevelEnabler) bool
- func IsIgnoredErr(err error) bool
- func Map[I, R any](input []I, f func(I) R) []R
- func NamespacedNameFromScaledObjectRef(sor *externalscaler.ScaledObjectRef) *types.NamespacedName
- func PrintBanner(noColor bool)
- func ResolveOsEnvBool(envName string, defaultValue bool) (bool, error)
- func ResolveOsEnvDuration(envName string) (*time.Duration, error)
- func ResolveOsEnvInt(envName string, defaultValue int) (int, error)
- func SetupLog(noColor bool) zapcore.LevelEnabler
- func SplitAfter(s string, re *regexp.Regexp) (r []string)
- type Config
Constants ¶
View Source
const ( MetadataClampMin = "clampMin" MetadataClampMax = "clampMax" MetadataMetricQuery = "metricQuery" MetadataTargetValue = "targetValue" MetadataOperationOverTime = "operationOverTime" MetadataOperationOverTimeDefaultValue = types.OpLastOne )
View Source
const DebugLvl = -1
Variables ¶
This section is empty.
Functions ¶
func CheckTimeOp ¶
func CheckTimeOp(op types.OperationOverTime) error
func ClampValue ¶
func ContextWithLogger ¶
func GetMetricQuery ¶
func GetOperationOvertTime ¶
func IsDebug ¶
func IsDebug(lvl zapcore.LevelEnabler) bool
func IsIgnoredErr ¶
func NamespacedNameFromScaledObjectRef ¶
func NamespacedNameFromScaledObjectRef(sor *externalscaler.ScaledObjectRef) *types.NamespacedName
func PrintBanner ¶
func PrintBanner(noColor bool)
func SetupLog ¶
func SetupLog(noColor bool) zapcore.LevelEnabler
SetupLog tweak the default log to use custom time format and use colors if supported
Types ¶
type Config ¶
type Config struct { OTLPReceiverPort int `envconfig:"OTLP_RECEIVER_PORT" default:"4317"` KedaExternalScalerPort int `envconfig:"KEDA_EXTERNAL_SCALER_PORT" default:"4318"` RestApiPort int `envconfig:"REST_API_PORT" default:"9090"` InternalMetricsPort int `envconfig:"INTERNAL_METRICS_PORT" default:"8080"` MetricStoreRetentionSeconds int `envconfig:"METRIC_STORE_RETENTION_SECONDS" default:"120"` NoColor bool `envconfig:"NO_COLOR" default:"false"` NoBanner bool `envconfig:"NO_BANNER" default:"false"` }
func MustParseConfig ¶
func MustParseConfig() *Config
Click to show internal directories.
Click to hide internal directories.