Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type ReConfiguration
- func (reConfiguration *ReConfiguration) Name() string
- func (reConfiguration *ReConfiguration) Process(ctx context.Context) error
- func (reConfiguration *ReConfiguration) ReConfiguration(configurator configurator.Configurator) error
- func (reConfiguration *ReConfiguration) SetStater(stater Stater)
- func (reConfiguration *ReConfiguration) Start(ctx context.Context)
- func (reConfiguration *ReConfiguration) State() State
- func (reConfiguration *ReConfiguration) Stater() Stater
- func (reConfiguration *ReConfiguration) Stop()
- type State
- type Stater
Constants ¶
View Source
const ( WarnPercentFieldName = "memory.percent.warn" CriticalPercentFieldName = "memory.percent.critical" ScanIntervalFieldName = "memory.scan_interval" WarnPercentDefault = uint8(60) CriticalPercentDefault = uint8(95) ScanIntervalDefault = time.Second )
Variables ¶
View Source
var Component = &app.Component{ Dependencies: app.Components{ logger.Component, configurator.Component, reConfiguration.Component, quota.Component, info.Component, runner.Component, }, Constructor: app.Constructor(func(container container.Container) error { return container.Provides( NewConfig, NewReConfigurationWithConfigurator, func(reConfiguration *ReConfiguration) Stater { return reConfiguration }, ) }), BindFlags: app.BindFlags(func(flagSet *pflag.FlagSet, container container.Container) error { return container.Invoke(func(config *Config) { flagSet.Uint8Var(&config.WarnPercent, WarnPercentFieldName, WarnPercentDefault, fmt.Sprintf( "percentage of used memory, after which the value will be set to %s", Warning, )) flagSet.Uint8Var(&config.CriticalPercent, CriticalPercentFieldName, CriticalPercentDefault, fmt.Sprintf( "percentage of used memory, after which the value will be set to %s", Critical, )) flagSet.DurationVar(&config.ScanInterval, ScanIntervalFieldName, ScanIntervalDefault, "timeout between memory scans") }) }), Run: app.Run(func(container container.Container) error { return container.Invoke(func( stater *ReConfiguration, reConfiguration reConfiguration.ReConfiguration, informer logger.Informer, info info.Info, config *Config, runner runner.Runner, ) error { reConfiguration.Registration(stater) informer.Info("memoryStater: registration in the reConfigurator") info.Registration("memory", config) return runner.AddProcesses(stater) }) }), }
Functions ¶
This section is empty.
Types ¶
type Config ¶
func Configuration ¶
func Configuration(config *Config, configurator configurator.Configurator) *Config
type ReConfiguration ¶
type ReConfiguration struct {
// contains filtered or unexported fields
}
func NewReConfiguration ¶
func NewReConfigurationWithConfigurator ¶
func NewReConfigurationWithConfigurator(quota quota.Quota, logger logger.Logger, config *Config, configurator configurator.Configurator) *ReConfiguration
func (*ReConfiguration) Name ¶ added in v1.8.12
func (reConfiguration *ReConfiguration) Name() string
func (*ReConfiguration) Process ¶ added in v1.8.12
func (reConfiguration *ReConfiguration) Process(ctx context.Context) error
func (*ReConfiguration) ReConfiguration ¶
func (reConfiguration *ReConfiguration) ReConfiguration(configurator configurator.Configurator) error
func (*ReConfiguration) SetStater ¶ added in v1.8.12
func (reConfiguration *ReConfiguration) SetStater(stater Stater)
func (*ReConfiguration) Start ¶ added in v1.8.12
func (reConfiguration *ReConfiguration) Start(ctx context.Context)
func (*ReConfiguration) State ¶
func (reConfiguration *ReConfiguration) State() State
func (*ReConfiguration) Stater ¶
func (reConfiguration *ReConfiguration) Stater() Stater
func (*ReConfiguration) Stop ¶ added in v1.8.12
func (reConfiguration *ReConfiguration) Stop()
type Stater ¶
func NewWithConfigurator ¶
func NewWithConfigurator( config *Config, configurator configurator.Configurator, logger logger.Logger, quota quota.Quota, ) (Stater, error)
Click to show internal directories.
Click to hide internal directories.