Documentation
¶
Index ¶
Constants ¶
const (
DefaultMySQLPort = 3306
)
Variables ¶
This section is empty.
Functions ¶
func MySQLHttpCheckHashKey ¶
func MySQLHttpCheckHashKey(clusterName string, key *InstanceKey) string
Types ¶
type ClusterInstanceKey ¶
type ClusterInstanceKey struct { ClusterName string Key InstanceKey }
func GetClusterInstanceKey ¶
func GetClusterInstanceKey(clusterName string, key *InstanceKey) ClusterInstanceKey
func (ClusterInstanceKey) HashCode ¶
func (c ClusterInstanceKey) HashCode() string
type ClusterProbes ¶
type InstanceKey ¶
InstanceKey is an instance indicator, identifued by hostname and port
func ParseInstanceKey ¶
func ParseInstanceKey(hostPort string, defaultPort int) (*InstanceKey, error)
ParseInstanceKey will parse an InstanceKey from a string representation such as 127.0.0.1:3306 or some.hostname `defaultPort` is used if `hostPort` does not include a port.
func (*InstanceKey) DisplayString ¶
func (this *InstanceKey) DisplayString() string
DisplayString returns a user-friendly string representation of this key
func (*InstanceKey) Equals ¶
func (this *InstanceKey) Equals(other *InstanceKey) bool
Equals tests equality between this key and another key
func (*InstanceKey) IsValid ¶
func (this *InstanceKey) IsValid() bool
IsValid uses simple heuristics to see whether this key represents an actual instance
func (*InstanceKey) SmallerThan ¶
func (this *InstanceKey) SmallerThan(other *InstanceKey) bool
SmallerThan returns true if this key is dictionary-smaller than another. This is used for consistent sorting/ordering; there's nothing magical about it.
func (InstanceKey) String ¶
func (this InstanceKey) String() string
String returns a user-friendly string representation of this key
func (*InstanceKey) StringCode ¶
func (this *InstanceKey) StringCode() string
StringCode returns an official string representation of this key
type InstanceMetricResultMap ¶
type InstanceMetricResultMap map[ClusterInstanceKey]base.MetricResult
type MySQLHttpCheck ¶
type MySQLHttpCheck struct { ClusterName string Key InstanceKey CheckResult int }
func CheckHttp ¶
func CheckHttp(clusterName string, probe *Probe) (httpCheckResult *MySQLHttpCheck)
func NewMySQLHttpCheck ¶
func NewMySQLHttpCheck(clusterName string, instanceKey *InstanceKey, checkResult int) *MySQLHttpCheck
func (*MySQLHttpCheck) HashKey ¶
func (check *MySQLHttpCheck) HashKey() string
type MySQLInventory ¶
type MySQLInventory struct { ClustersProbes map[string](*Probes) IgnoreHostsCount map[string]int IgnoreHostsThreshold map[string]float64 InstanceKeyMetrics InstanceMetricResultMap ClusterInstanceHttpChecks ClusterInstanceHttpCheckResultMap }
func NewMySQLInventory ¶
func NewMySQLInventory() *MySQLInventory
type MySQLThrottleMetric ¶
type MySQLThrottleMetric struct { ClusterName string Key InstanceKey Value float64 Err error }
func NewMySQLThrottleMetric ¶
func NewMySQLThrottleMetric() *MySQLThrottleMetric
func ReadThrottleMetric ¶
func ReadThrottleMetric(probe *Probe, clusterName string) (mySQLThrottleMetric *MySQLThrottleMetric)
ReadThrottleMetric returns replication lag for a given connection config; either by explicit query or via SHOW SLAVE STATUS
func (*MySQLThrottleMetric) Get ¶
func (metric *MySQLThrottleMetric) Get() (float64, error)
func (*MySQLThrottleMetric) GetClusterInstanceKey ¶
func (metric *MySQLThrottleMetric) GetClusterInstanceKey() ClusterInstanceKey
func (*MySQLThrottleMetric) HashCode ¶
func (metric *MySQLThrottleMetric) HashCode() string
type Probe ¶
type Probe struct { Key InstanceKey User string Password string MetricQuery string CacheMillis int QueryInProgress int64 HttpCheckPort int HttpCheckPath string HttpCheckInProgress int64 }
Probe is the minimal configuration required to connect to a MySQL server
func (*Probe) DuplicateCredentials ¶
func (probe *Probe) DuplicateCredentials(key InstanceKey) *Probe
DuplicateCredentials creates a new connection config with given key and with same credentials as this config