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 target GOGC value if specified, // It is effective when MaxRAMPercentage == 0, // the default value is the value read from the `GOGC` environment variable, // or 100 if the `GOGC` environment variable is not set. // See debug.SetGCPercent(GOGC) 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.