metric

package
v0.0.0-...-13a9703 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricMap = new(sync.Map)
)

Functions

func AddMetric

func AddMetric(id int)

func CalcPrometheusMetrics

func CalcPrometheusMetrics()

CalcPrometheusMetrics calculates some prometheus metrics e.g. average delay.

func CreateMetric

func CreateMetric(r base.Runner)

Types

type Combine

type Combine struct {
	Total uint64 // total number
	Delta        // delta
}

func (*Combine) Set

func (c *Combine) Set(val uint64)

type Delta

type Delta struct {
	Value uint64 // current value
}

func (*Delta) Update

func (d *Delta) Update()

type Metric

type Metric struct {
	PullCmdCount    Combine
	BypassCmdCount  Combine
	PushCmdCount    Combine
	SuccessCmdCount Combine
	FailCmdCount    Combine

	Delay       Percent // ms
	AvgDelay    Percent // ms
	NetworkFlow Combine // +speed

	FullSyncProgress uint64
}

main struct

func GetMetric

func GetMetric(id int) *Metric

func (*Metric) AddBypassCmdCount

func (m *Metric) AddBypassCmdCount(dbSyncerID int, val uint64)

func (*Metric) AddDelay

func (m *Metric) AddDelay(val uint64)

func (*Metric) AddFailCmdCount

func (m *Metric) AddFailCmdCount(dbSyncerID int, val uint64)

func (*Metric) AddNetworkFlow

func (m *Metric) AddNetworkFlow(dbSyncerID int, val uint64)

func (*Metric) AddPullCmdCount

func (m *Metric) AddPullCmdCount(dbSyncerID int, val uint64)

func (*Metric) AddPushCmdCount

func (m *Metric) AddPushCmdCount(dbSyncerID int, val uint64)

func (*Metric) AddSuccessCmdCount

func (m *Metric) AddSuccessCmdCount(dbSyncerID int, val uint64)

func (*Metric) GetAvgDelay

func (m *Metric) GetAvgDelay() interface{}

func (*Metric) GetAvgDelayFloat64

func (m *Metric) GetAvgDelayFloat64() float64

func (*Metric) GetBypassCmdCount

func (m *Metric) GetBypassCmdCount() interface{}

func (*Metric) GetBypassCmdCountTotal

func (m *Metric) GetBypassCmdCountTotal() interface{}

func (*Metric) GetDelay

func (m *Metric) GetDelay() interface{}

func (*Metric) GetFailCmdCount

func (m *Metric) GetFailCmdCount() interface{}

func (*Metric) GetFailCmdCountTotal

func (m *Metric) GetFailCmdCountTotal() interface{}

func (*Metric) GetFullSyncProgress

func (m *Metric) GetFullSyncProgress() interface{}

func (*Metric) GetNetworkFlow

func (m *Metric) GetNetworkFlow() interface{}

func (*Metric) GetNetworkFlowTotal

func (m *Metric) GetNetworkFlowTotal() interface{}

func (*Metric) GetPullCmdCount

func (m *Metric) GetPullCmdCount() interface{}

func (*Metric) GetPullCmdCountTotal

func (m *Metric) GetPullCmdCountTotal() interface{}

func (*Metric) GetPushCmdCount

func (m *Metric) GetPushCmdCount() interface{}

func (*Metric) GetPushCmdCountTotal

func (m *Metric) GetPushCmdCountTotal() interface{}

func (*Metric) GetSuccessCmdCount

func (m *Metric) GetSuccessCmdCount() interface{}

func (*Metric) GetSuccessCmdCountTotal

func (m *Metric) GetSuccessCmdCountTotal() interface{}

func (*Metric) SetFullSyncProgress

func (m *Metric) SetFullSyncProgress(dbSyncerID int, val uint64)

type MetricRest

type MetricRest struct {
	StartTime            interface{}
	PullCmdCount         interface{}
	PullCmdCountTotal    interface{}
	BypassCmdCount       interface{}
	BypassCmdCountTotal  interface{}
	PushCmdCount         interface{}
	PushCmdCountTotal    interface{}
	SuccessCmdCount      interface{}
	SuccessCmdCountTotal interface{}
	FailCmdCount         interface{}
	FailCmdCountTotal    interface{}
	Delay                interface{}
	AvgDelay             interface{}
	NetworkSpeed         interface{} // network speed
	NetworkFlowTotal     interface{} // total network speed
	FullSyncProgress     interface{}
	Status               interface{}
	SenderBufCount       interface{} // length of sender buffer
	ProcessingCmdCount   interface{} // length of delay channel
	TargetDBOffset       interface{} // target redis offset
	SourceDBOffset       interface{} // source redis offset
	SourceAddress        interface{}
	TargetAddress        interface{}
	Details              interface{} // other details info
}

func NewMetricRest

func NewMetricRest() []MetricRest

type Op

type Op interface {
	Update()
}

type Percent

type Percent struct {
	Dividend uint64
	Divisor  uint64
}

func (*Percent) Get

func (p *Percent) Get(returnString bool) interface{}

input: return string?

func (*Percent) Set

func (p *Percent) Set(dividend, divisor uint64)

func (*Percent) Update

func (p *Percent) Update()

Jump to

Keyboard shortcuts

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