repllag

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOMAIN = "repl.lag"

	OPT_HEARTBEAT_SOURCE_ID   = "source-id"
	OPT_HEARTBEAT_SOURCE_ROLE = "source-role"
	OPT_HEARTBEAT_TABLE       = "table"
	OPT_WRITER                = "writer"
	OPT_REPL_CHECK            = "repl-check"
	OPT_REPORT_NO_HEARTBEAT   = "report-no-heartbeat"
	OPT_REPORT_NOT_A_REPLICA  = "report-not-a-replica"
	OPT_DEFAULT_CHANNEL_NAME  = "default-channel-name"
	OPT_NETWORK_LATENCY       = "network-latency"

	LAG_WRITER_BLIP = "blip"
	LAG_WRITER_PFS  = "pfs"
)
View Source
const (
	O_APPLYING = "a" // at least 1 worker applying
	O_RECEIVED = "r" // no workers applying but more trx queued
	O_STOPPED  = "x" // IO or SQL thread != "ON"
	O_IDLE     = " " // none of the above == true zero lag
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Lag

type Lag struct {
	// contains filtered or unexported fields
}

func NewLag

func NewLag(db *sql.DB) *Lag

func (*Lag) Collect

func (c *Lag) Collect(ctx context.Context, levelName string) ([]blip.MetricValue, error)

func (*Lag) Domain

func (c *Lag) Domain() string

func (*Lag) Help

func (c *Lag) Help() blip.CollectorHelp

func (*Lag) Prepare

func (c *Lag) Prepare(ctx context.Context, plan blip.Plan) (func(), error)

Prepare prepares one lag collector for all levels in the plan. Lag can (and probably will be) collected at multiple levels, but this domain can be configured at only one level. For example, it's not possible to collect lag from a Blip heartbeat and from Performance Schema. And since this domain collects only one metric (repl.lag.current), there's no need to collect different metrics at different frequencies.

Jump to

Keyboard shortcuts

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