mysql

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterProbes

type ClusterProbes struct {
	ClusterName          string
	IgnoreHostsCount     int
	IgnoreHostsThreshold float64
	TabletProbes         Probes
}

ClusterProbes has the probes for a specific cluster

type ClusterTablet added in v0.19.0

type ClusterTablet struct {
	ClusterName string
	Alias       string
}

ClusterTablet combines a cluster name with a tablet alias

func GetClusterTablet added in v0.19.0

func GetClusterTablet(clusterName string, alias string) ClusterTablet

GetClusterTablet creates a GetClusterTablet object

type Inventory

type Inventory struct {
	ClustersProbes       map[string](Probes)
	IgnoreHostsCount     map[string]int
	IgnoreHostsThreshold map[string]float64
	TabletMetrics        TabletResultMap
}

Inventory has the operational data about probes, their metrics, and relevant configuration

func NewInventory

func NewInventory() *Inventory

NewInventory creates a Inventory

type MetricsQueryType added in v0.10.0

type MetricsQueryType int

MetricsQueryType indicates the type of metrics query on MySQL backend. See following.

const (
	// MetricsQueryTypeDefault indicates the default, internal implementation. Specifically, our throttler runs a replication lag query
	MetricsQueryTypeDefault MetricsQueryType = iota
	// MetricsQueryTypeShowGlobal indicates SHOW GLOBAL (STATUS|VARIABLES) query
	MetricsQueryTypeShowGlobal
	// MetricsQueryTypeSelect indicates a custom SELECT query
	MetricsQueryTypeSelect
	// MetricsQueryTypeUnknown is an unknown query type, which we cannot run. This is an error
	MetricsQueryTypeUnknown
)

func GetMetricsQueryType added in v0.10.0

func GetMetricsQueryType(query string) MetricsQueryType

GetMetricsQueryType analyzes the type of a metrics query

type MySQLThrottleMetric

type MySQLThrottleMetric struct {
	ClusterName string
	Alias       string
	Value       float64
	Err         error
}

MySQLThrottleMetric has the probed metric for a tablet

func NewMySQLThrottleMetric

func NewMySQLThrottleMetric() *MySQLThrottleMetric

NewMySQLThrottleMetric creates a new MySQLThrottleMetric

func ReadThrottleMetric

func ReadThrottleMetric(probe *Probe, clusterName string, overrideGetMetricFunc func() *MySQLThrottleMetric) (mySQLThrottleMetric *MySQLThrottleMetric)

ReadThrottleMetric returns a metric for the given probe. Either by explicit query or via SHOW REPLICA STATUS

func (*MySQLThrottleMetric) Get

func (metric *MySQLThrottleMetric) Get() (float64, error)

Get implements MetricResult

func (*MySQLThrottleMetric) GetClusterTablet added in v0.19.0

func (metric *MySQLThrottleMetric) GetClusterTablet() ClusterTablet

GetClusterTablet returns the ClusterTablet part of the metric

type Probe

type Probe struct {
	Alias           string
	MetricQuery     string
	Tablet          *topodatapb.Tablet
	CacheMillis     int
	QueryInProgress int64
}

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

func NewProbe

func NewProbe() *Probe

NewProbe creates Probe

func (*Probe) String

func (p *Probe) String() string

String returns a human readable string of this struct

type Probes

type Probes map[string](*Probe)

Probes maps tablet aliases to probe(s)

func NewProbes

func NewProbes() Probes

NewProbes creates Probes

type TabletResultMap added in v0.19.0

type TabletResultMap map[ClusterTablet]base.MetricResult

TabletResultMap maps a cluster-tablet to a result

Jump to

Keyboard shortcuts

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