guardrails

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_CONFIG_KEY       = "guardrail_settings"
	MEMORY_THRESHOLD_DEFAULT = 90
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MemoryThreshold float64 `mapstructure:"memory_threshold" validate:"gte=1,lte=100"`
}

func ConfigFromViper

func ConfigFromViper(key *string) (Config, error)

type CriticalityLevel

type CriticalityLevel string
const (
	// Critical is a guardrail that is critical to the operation of the database
	// and should be reverted immediately. This also means that the DBtune server
	// will revert to the baseline configuration to stabilise the system before recommending
	// a new configuration.
	Critical CriticalityLevel = "critical"
	// NonCritical is a guardrail that is not critical
	// to the operation of the database, but a new configuration
	// is recommended to be applied.
	NonCritical CriticalityLevel = "non-critical"
)

type Signal

type Signal struct {
	Level CriticalityLevel `json:"level"`
	Type  Type             `json:"type"`
}

type Type

type Type string
const (
	// Memory is a guardrail that is related to the memory of the database
	Memory         Type = "memory"
	FreeableMemory Type = "freeable_memory"
)

Jump to

Keyboard shortcuts

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