common

package
v0.0.0-...-b2a4f9a Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RedoWriteBytesGauge records the total number of bytes written to redo log.
	RedoWriteBytesGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Subsystem: subsystem,
		Name:      "write_bytes_total",
		Help:      "Total number of bytes redo log written",
	}, []string{"namespace", "changefeed", "type"})

	// RedoFsyncDurationHistogram records the latency distributions of fsync called by redo writer.
	RedoFsyncDurationHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: namespace,
		Subsystem: subsystem,
		Name:      "fsync_duration_seconds",
		Help:      "The latency distributions of fsync called by redo writer",
		Buckets:   prometheus.ExponentialBuckets(0.001, 2.0, 16),
	}, []string{"namespace", "changefeed", "type"})

	// RedoFlushAllDurationHistogram records the latency distributions of flushAll
	// called by redo writer.
	RedoFlushAllDurationHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: namespace,
		Subsystem: subsystem,
		Name:      "flush_all_duration_seconds",
		Help:      "The latency distributions of flushall called by redo writer",
		Buckets:   prometheus.ExponentialBuckets(0.001, 2.0, 16),
	}, []string{"namespace", "changefeed", "type"})

	// RedoTotalRowsCountGauge records the total number of rows written to redo log.
	RedoTotalRowsCountGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Subsystem: subsystem,
		Name:      "total_rows_count",
		Help:      "The total count of rows that are processed by redo writer",
	}, []string{"namespace", "changefeed", "type"})

	// RedoWriteLogDurationHistogram records the latency distributions of writeLog.
	RedoWriteLogDurationHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: namespace,
		Subsystem: subsystem,
		Name:      "write_log_duration_seconds",
		Help:      "The latency distributions of writeLog called by redoManager",
		Buckets:   prometheus.ExponentialBuckets(0.001, 2.0, 16),
	}, []string{"namespace", "changefeed", "type"})

	// RedoFlushLogDurationHistogram records the latency distributions of flushLog.
	RedoFlushLogDurationHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: namespace,
		Subsystem: subsystem,
		Name:      "flush_log_duration_seconds",
		Help:      "The latency distributions of flushLog called by redoManager",
		Buckets:   prometheus.ExponentialBuckets(0.001, 2.0, 16),
	}, []string{"namespace", "changefeed", "type"})

	// RedoWorkerBusyRatio records the busy ratio of redo bgUpdateLog worker.
	RedoWorkerBusyRatio = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: namespace,
			Subsystem: subsystem,
			Name:      "worker_busy_ratio",
			Help:      "Busy ratio for redo bgUpdateLog worker.",
		}, []string{"namespace", "changefeed", "type"})
)

Functions

func FilterChangefeedFiles

func FilterChangefeedFiles(files []string, changefeedID model.ChangeFeedID) []string

FilterChangefeedFiles return the files that match to the changefeed.

func InitMetrics

func InitMetrics(registry *prometheus.Registry)

InitMetrics registers all metrics in this file

func ParseMeta

func ParseMeta(metas []*LogMeta, checkpointTs, resolvedTs *model.Ts)

ParseMeta parses meta.

Types

type LogMeta

type LogMeta struct {
	CheckpointTs uint64 `msg:"checkpointTs"`
	ResolvedTs   uint64 `msg:"resolvedTs"`
}

LogMeta is used for store meta info.

func (*LogMeta) DecodeMsg

func (z *LogMeta) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (LogMeta) EncodeMsg

func (z LogMeta) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (LogMeta) MarshalMsg

func (z LogMeta) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (LogMeta) Msgsize

func (z LogMeta) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*LogMeta) UnmarshalMsg

func (z *LogMeta) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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