config

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Instance is the one configuration for the throttler

Functions

This section is empty.

Types

type ConfigurationSettings

type ConfigurationSettings struct {
	ListenPort      int
	DataCenter      string
	Environment     string
	Domain          string
	EnableProfiling bool // enable pprof profiling http api
	Stores          StoresSettings
}

ConfigurationSettings models a set of configurable values, that can be provided by the user via one or several JSON formatted files.

Some of the settings have reasonable default values, and some other (like database credentials) are strictly expected from user.

func Settings

func Settings() *ConfigurationSettings

Settings returns the settings of the global instance of Configuration

type MySQLClusterConfigurationSettings

type MySQLClusterConfigurationSettings struct {
	MetricQuery          string         // override MySQLConfigurationSettings's, or leave empty to inherit those settings
	CacheMillis          int            // override MySQLConfigurationSettings's, or leave empty to inherit those settings
	ThrottleThreshold    *atomic.Uint64 // override MySQLConfigurationSettings's, or leave empty to inherit those settings
	Port                 int            // Specify if different than 3306 or if different than specified by MySQLConfigurationSettings
	IgnoreHostsCount     int            // Number of hosts that can be skipped/ignored even on error or on exceeding thresholds
	IgnoreHostsThreshold float64        // Threshold beyond which IgnoreHostsCount applies (default: 0)
	HTTPCheckPort        int            // Specify if different than specified by MySQLConfigurationSettings. -1 to disable HTTP check
	HTTPCheckPath        string         // Specify if different than specified by MySQLConfigurationSettings
	IgnoreHosts          []string       // override MySQLConfigurationSettings's, or leave empty to inherit those settings
}

MySQLClusterConfigurationSettings has the settings for a specific MySQL cluster. It derives its information from MySQLConfigurationSettings

type MySQLConfigurationSettings

type MySQLConfigurationSettings struct {
	MetricQuery          string
	CacheMillis          int // optional, if defined then probe result will be cached, and future probes may use cached value
	ThrottleThreshold    *atomic.Uint64
	Port                 int      // Specify if different than 3306; applies to all clusters
	IgnoreDialTCPErrors  bool     // Skip hosts where a metric cannot be retrieved due to TCP dial errors
	IgnoreHostsCount     int      // Number of hosts that can be skipped/ignored even on error or on exceeding thresholds
	IgnoreHostsThreshold float64  // Threshold beyond which IgnoreHostsCount applies (default: 0)
	HTTPCheckPort        int      // port for HTTP check. -1 to disable.
	HTTPCheckPath        string   // If non-empty, requires HTTPCheckPort
	IgnoreHosts          []string // If non empty, substrings to indicate hosts to be ignored/skipped

	Clusters map[string](*MySQLClusterConfigurationSettings) // cluster name -> cluster config
}

MySQLConfigurationSettings has the general configuration for all MySQL clusters

type StoresSettings

type StoresSettings struct {
	MySQL MySQLConfigurationSettings // Any and all MySQL setups go here

}

StoresSettings is a general settings container for specific stores.

Jump to

Keyboard shortcuts

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