provider

package
v0.0.0-...-0bb476f Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: PostgreSQL Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxRelative

func MaxRelative(metrics, threshold []float64) (val float64, kind int)

Types

type BalancerImpl

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

func NewBalancer

func NewBalancer() (*BalancerImpl, error)

func (*BalancerImpl) RunBalancer

func (b *BalancerImpl) RunBalancer(ctx context.Context)

type HostMetrics

type HostMetrics []float64

func NewHostMetrics

func NewHostMetrics() HostMetrics

func (HostMetrics) MaxRelative

func (m HostMetrics) MaxRelative(threshold []float64) (val float64)

type ShardMetrics

type ShardMetrics struct {
	ShardId       string
	MetricsTotal  []float64
	MetricsKR     map[string][]float64 // mean value for object by key range
	KeyCountKR    map[string]int64
	KeyCountRelKR map[string]map[string]int64
	Master        string
	TargetReplica string
}

func NewShardMetrics

func NewShardMetrics() *ShardMetrics

func (*ShardMetrics) SetMasterMetrics

func (m *ShardMetrics) SetMasterMetrics(metrics HostMetrics)

func (*ShardMetrics) SetReplicaMetrics

func (m *ShardMetrics) SetReplicaMetrics(metrics HostMetrics)

Jump to

Keyboard shortcuts

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