metrics

package
v0.0.0-...-cc2de37 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	BinlogEventCostStageDDLExec = "ddl-exec"
	BinlogEventCostStageDMLExec = "dml-exec"

	BinlogEventCostStageGenWriteRows  = "gen-write-rows"
	BinlogEventCostStageGenUpdateRows = "gen-update-rows"
	BinlogEventCostStageGenDeleteRows = "gen-delete-rows"
	BinlogEventCostStageGenQuery      = "gen-query"
)

for BinlogEventCost metric stage field.

Variables

This section is empty.

Functions

func RegisterValidatorMetrics

func RegisterValidatorMetrics(registry *prometheus.Registry)

func RemoveValidatorLabelValuesWithTask

func RemoveValidatorLabelValuesWithTask(task string)

Types

type Metrics

type Metrics struct {
	BinlogReadDurationHistogram      prometheus.Observer
	BinlogEventSizeHistogram         prometheus.Observer
	ConflictDetectDurationHistogram  prometheus.Observer
	IdealQPS                         prometheus.Gauge
	BinlogMasterPosGauge             prometheus.Gauge
	BinlogSyncerPosGauge             prometheus.Gauge
	BinlogMasterFileGauge            prometheus.Gauge
	BinlogSyncerFileGauge            prometheus.Gauge
	BinlogEventRowHistogram          prometheus.Observer
	TxnHistogram                     prometheus.Observer
	QueryHistogram                   prometheus.Observer
	ExitWithResumableErrorCounter    prometheus.Counter
	ExitWithNonResumableErrorCounter prometheus.Counter
	ReplicationLagGauge              prometheus.Gauge
	ReplicationLagHistogram          prometheus.Observer
	RemainingTimeGauge               prometheus.Gauge
	ShardLockResolving               prometheus.Gauge
	FinishedTransactionTotal         prometheus.Counter
	FlushCheckPointsTimeInterval     prometheus.Observer
}

Metrics groups syncer's metric variables.

type Proxies

type Proxies struct {
	Metrics *Metrics

	BinlogEventCost *prometheus.HistogramVec

	AddJobDurationHistogram *prometheus.HistogramVec
	// dispatch/add multiple jobs for one binlog event.
	// NOTE: only observe for DML now.
	DispatchBinlogDurationHistogram *prometheus.HistogramVec
	SkipBinlogDurationHistogram     *prometheus.HistogramVec
	AddedJobsTotal                  *prometheus.CounterVec
	FinishedJobsTotal               *prometheus.CounterVec

	QueueSizeGauge *prometheus.GaugeVec

	StmtHistogram *prometheus.HistogramVec

	UnsyncedTableGauge *prometheus.GaugeVec

	ReplicationTransactionBatch *prometheus.HistogramVec
	// contains filtered or unexported fields
}

Proxies provides the ability to clean Metrics values when syncer is closed. private members have a corresponding cached variable in Metrics.

var DefaultMetricsProxies *Proxies

func (*Proxies) CacheForOneTask

func (m *Proxies) CacheForOneTask(taskName, workerName, sourceID string) *Proxies

CacheForOneTask returns a new Proxies with m.Metrics filled. It is used to avoid calling WithLabelValues in hot path.

func (*Proxies) Init

func (m *Proxies) Init(f promutil.Factory)

Init creates Metrics proxy variables from Factory.

func (*Proxies) RegisterMetrics

func (m *Proxies) RegisterMetrics(registry *prometheus.Registry)

RegisterMetrics registers Proxies.

func (*Proxies) RemoveLabelValuesWithTaskInMetrics

func (m *Proxies) RemoveLabelValuesWithTaskInMetrics(task string)

RemoveLabelValuesWithTaskInMetrics cleans all Metrics related to the task.

type ValidatorMetrics

type ValidatorMetrics struct {
	ErrorCount     prometheus.Gauge
	LogPosLatency  prometheus.Gauge
	LogFileLatency prometheus.Gauge
	BinlogFile     prometheus.Gauge
	BinlogPos      prometheus.Gauge
}

func NewValidatorMetrics

func NewValidatorMetrics(taskName, sourceID string) *ValidatorMetrics

Jump to

Keyboard shortcuts

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