configs

package
v1.22.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DB  db.Config  `yaml:"database"`
	API api.Config `yaml:"api"`
}

func (*Config) RegisterFlags added in v0.7.0

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to configure this to the given FlagSet.

type EvictionConfig

type EvictionConfig struct {
	Threshold            Threshold     `yaml:"threshold"`
	CheckInterval        time.Duration `yaml:"check_interval"`
	CooldownPeriod       int           `yaml:"cooldown_period"`
	EvictionMetric       string        `yaml:"eviction_metric"`
	MinQueryAge          time.Duration `yaml:"min_query_age"`
	MaxEvictionsPerCycle int           `yaml:"max_evictions_per_cycle"`
}

EvictionConfig configures the resource-based query evictor.

func (EvictionConfig) Enabled

func (c EvictionConfig) Enabled() bool

Enabled returns true when at least one eviction threshold is greater than 0.

type QueryProtection added in v1.20.0

type QueryProtection struct {
	Rejection rejection      `json:"rejection"`
	Eviction  EvictionConfig `yaml:"eviction"`
}

func (*QueryProtection) RegisterFlagsWithPrefix added in v1.20.0

func (cfg *QueryProtection) RegisterFlagsWithPrefix(f *flag.FlagSet, prefix string)

func (*QueryProtection) Validate added in v1.20.0

func (cfg *QueryProtection) Validate(monitoredResources flagext.StringSliceCSV) error

type ResourceMonitor added in v1.20.0

type ResourceMonitor struct {
	Resources       flagext.StringSliceCSV `yaml:"resources"`
	Interval        time.Duration          `yaml:"interval"`
	CPURateInterval time.Duration          `yaml:"cpu_rate_interval"`
}

func (*ResourceMonitor) RegisterFlags added in v1.20.0

func (cfg *ResourceMonitor) RegisterFlags(f *flag.FlagSet)

func (*ResourceMonitor) Validate added in v1.20.0

func (cfg *ResourceMonitor) Validate() error

type Threshold

type Threshold struct {
	CPUUtilization  float64 `yaml:"cpu_utilization"`
	HeapUtilization float64 `yaml:"heap_utilization"`
}

Threshold holds CPU and heap utilization thresholds (0-1 range).

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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