mysql

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMySQLPort = 3306
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterProbes

type ClusterProbes struct {
	ClusterName      string
	IgnoreHostsCount int
	Probes           *Probes
}

type InstanceKey

type InstanceKey struct {
	Hostname string
	Port     int
}

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[InstanceKey]base.MetricResult

type MySQLInventory

type MySQLInventory struct {
	ClustersProbes     map[string](*Probes)
	IgnoreHostsCount   map[string]int
	InstanceKeyMetrics InstanceMetricResultMap
}

func NewMySQLInventory

func NewMySQLInventory() *MySQLInventory

type MySQLThrottleMetric

type MySQLThrottleMetric struct {
	Key   InstanceKey
	Value float64
	Err   error
}

func NewMySQLThrottleMetric

func NewMySQLThrottleMetric() *MySQLThrottleMetric

func ReadThrottleMetric

func ReadThrottleMetric(probe *Probe) (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)

type Probe

type Probe struct {
	Key         InstanceKey
	User        string
	Password    string
	MetricQuery string
	InProgress  int64
}

Probe is the minimal configuration required to connect to a MySQL server

func NewProbe

func NewProbe() *Probe

func (*Probe) Duplicate

func (this *Probe) Duplicate() *Probe

func (*Probe) DuplicateCredentials

func (this *Probe) DuplicateCredentials(key InstanceKey) *Probe

DuplicateCredentials creates a new connection config with given key and with same credentials as this config

func (*Probe) Equals

func (this *Probe) Equals(other *Probe) bool

func (*Probe) GetDBUri

func (this *Probe) GetDBUri(databaseName string) string

func (*Probe) String

func (this *Probe) String() string

type Probes

type Probes map[InstanceKey](*Probe)

func NewProbes

func NewProbes() *Probes

Jump to

Keyboard shortcuts

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