vitess.io/vitess@v0.16.2/go/vt/vttablet/tabletserver/throttle/config/mysql_config.go (about)

     1  /*
     2   Copyright 2017 GitHub Inc.
     3  
     4   Licensed under MIT License. See https://github.com/github/freno/blob/master/LICENSE
     5  */
     6  
     7  package config
     8  
     9  import "vitess.io/vitess/go/sync2"
    10  
    11  //
    12  // MySQL-specific configuration
    13  //
    14  
    15  // MySQLClusterConfigurationSettings has the settings for a specific MySQL cluster. It derives its information
    16  // from MySQLConfigurationSettings
    17  type MySQLClusterConfigurationSettings struct {
    18  	MetricQuery          string               // override MySQLConfigurationSettings's, or leave empty to inherit those settings
    19  	CacheMillis          int                  // override MySQLConfigurationSettings's, or leave empty to inherit those settings
    20  	ThrottleThreshold    *sync2.AtomicFloat64 // override MySQLConfigurationSettings's, or leave empty to inherit those settings
    21  	Port                 int                  // Specify if different than 3306 or if different than specified by MySQLConfigurationSettings
    22  	IgnoreHostsCount     int                  // Number of hosts that can be skipped/ignored even on error or on exceeding thresholds
    23  	IgnoreHostsThreshold float64              // Threshold beyond which IgnoreHostsCount applies (default: 0)
    24  	HTTPCheckPort        int                  // Specify if different than specified by MySQLConfigurationSettings. -1 to disable HTTP check
    25  	HTTPCheckPath        string               // Specify if different than specified by MySQLConfigurationSettings
    26  	IgnoreHosts          []string             // override MySQLConfigurationSettings's, or leave empty to inherit those settings
    27  }
    28  
    29  // MySQLConfigurationSettings has the general configuration for all MySQL clusters
    30  type MySQLConfigurationSettings struct {
    31  	MetricQuery          string
    32  	CacheMillis          int // optional, if defined then probe result will be cached, and future probes may use cached value
    33  	ThrottleThreshold    *sync2.AtomicFloat64
    34  	Port                 int      // Specify if different than 3306; applies to all clusters
    35  	IgnoreDialTCPErrors  bool     // Skip hosts where a metric cannot be retrieved due to TCP dial errors
    36  	IgnoreHostsCount     int      // Number of hosts that can be skipped/ignored even on error or on exceeding thresholds
    37  	IgnoreHostsThreshold float64  // Threshold beyond which IgnoreHostsCount applies (default: 0)
    38  	HTTPCheckPort        int      // port for HTTP check. -1 to disable.
    39  	HTTPCheckPath        string   // If non-empty, requires HTTPCheckPort
    40  	IgnoreHosts          []string // If non empty, substrings to indicate hosts to be ignored/skipped
    41  
    42  	Clusters map[string](*MySQLClusterConfigurationSettings) // cluster name -> cluster config
    43  }