Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterInstanceKey ¶
type ClusterInstanceKey struct { ClusterName string Key InstanceKey }
ClusterInstanceKey combines a cluster name with an instance key
func GetClusterInstanceKey ¶
func GetClusterInstanceKey(clusterName string, key *InstanceKey) ClusterInstanceKey
GetClusterInstanceKey creates a ClusterInstanceKey object
type ClusterProbes ¶
type ClusterProbes struct { ClusterName string IgnoreHostsCount int IgnoreHostsThreshold float64 InstanceProbes *Probes }
ClusterProbes has the probes for a specific cluster
type InstanceKey ¶
InstanceKey is an instance indicator, identified 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 (i *InstanceKey) DisplayString() string
DisplayString returns a user-friendly string representation of this key
func (*InstanceKey) Equals ¶
func (i *InstanceKey) Equals(other *InstanceKey) bool
Equals tests equality between this key and another key
func (*InstanceKey) IsValid ¶
func (i *InstanceKey) IsValid() bool
IsValid uses simple heuristics to see whether this key represents an actual instance
func (*InstanceKey) SmallerThan ¶
func (i *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 (i InstanceKey) String() string
String returns a user-friendly string representation of this key
func (*InstanceKey) StringCode ¶
func (i *InstanceKey) StringCode() string
StringCode returns an official string representation of this key
type InstanceMetricResultMap ¶
type InstanceMetricResultMap map[ClusterInstanceKey]base.MetricResult
InstanceMetricResultMap maps a cluster-instance to a result
type Inventory ¶
type Inventory struct { ClustersProbes map[string](*Probes) IgnoreHostsCount map[string]int IgnoreHostsThreshold map[string]float64 InstanceKeyMetrics InstanceMetricResultMap }
Inventory has the operational data about probes, their metrics, and relevant configuration
type MySQLThrottleMetric ¶
type MySQLThrottleMetric struct { ClusterName string Key InstanceKey Value float64 Err error }
MySQLThrottleMetric has the probed metric for a mysql instance
func NewMySQLThrottleMetric ¶
func NewMySQLThrottleMetric() *MySQLThrottleMetric
NewMySQLThrottleMetric creates a new 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)
Get implements MetricResult
func (*MySQLThrottleMetric) GetClusterInstanceKey ¶
func (metric *MySQLThrottleMetric) GetClusterInstanceKey() ClusterInstanceKey
GetClusterInstanceKey returns the ClusterInstanceKey part of the metric
type Probe ¶
type Probe struct { Key InstanceKey User string Password string MetricQuery string CacheMillis int QueryInProgress int64 }
Probe is the minimal configuration required to connect to a MySQL server
func (*Probe) DuplicateCredentials ¶
func (p *Probe) DuplicateCredentials(key InstanceKey) *Probe
DuplicateCredentials creates a new connection config with given key and with same credentials as this config