Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableGCTuner ¶
func NewGcConfigurator ¶ added in v0.1.1
func NewGcConfigurator() *gcConfigurator
Types ¶
type Config ¶
type Config struct { // GOGC is the maximum effective GOGC if specified. // When MaxRAMPercentage == 0, the GOGC pararameter will be set to debug.SetGCPercent. // If MaxRAMPercentage is set, in go1.18 and lower, gctuner dynamically adjusts GOGC(debug.SetGCPercent) // to meet the target memory limit, the GOGC specified here limits the maximum GOGC value. // In go1.19 and above, gctuner uses GOMEMLIMIT (debug.SetMemoryLimit) to meet target memory limit, // if GOGC is specified here, memory will be controlled by both GOGC and GOMEMLIMIT, triggering either of them will trigger GC. // In general, it is recommended that the user directly use MaxRAMPercentage without setting the GOGC parameter here. GOGC int `json:"gogc,omitempty" yaml:"gogc,omitempty"` // MaxRAMPercentage is the maximum memory usage, range (0, 100] MaxRAMPercentage float64 `json:"max_ram_percentage,omitempty" yaml:"max_ram_percentage,omitempty"` }
Config is the configuration for adaptive GC
func (*Config) CheckValid ¶
type Configurator ¶
type Configurator interface { // GetConfig retrieves the gctuner Config GetConfig() (Config, error) // Updates is the channel of config update events, which will be triggered upon config updates. // It returns nil if the configurator does not support config updates. // The gctuner will obtain the latest config by calling GetConfig. Updates() <-chan interface{} }
Configurator is an interface for configuration management
type Option ¶
type Option func(*opts)
func WithConfigurator ¶
func WithConfigurator(configurator Configurator) Option
WithConfigurator sets the configurator for gctuner
func WithLogger ¶
WithLogger sets the logger for gctuner, if not specified, a stdout logger is used by default.
func WithStaticConfig ¶
WithStaticConfig sets a static config for gctuner, which will not be updated.
Click to show internal directories.
Click to hide internal directories.