ewma

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	ErrHandler func(err error) (isErr bool)
}

Builder is ewma node builder.

func (*Builder) Build

Build create a weighted node.

type Node

type Node struct {
	selector.Node
	// contains filtered or unexported fields
}

Node is endpoint instance ewma -> Exponentially Weighted Averages 指数移动加权平均,体现的是一段时间内的平均值 ewma node is a weighted node, it will collect statistic data and calculate a weight. 配合ewma算法,实现 p2c 负载均衡算法

func (*Node) Pick

func (n *Node) Pick() selector.DoneFunc

Pick pick a node.

func (*Node) PickElapsed

func (n *Node) PickElapsed() time.Duration

func (*Node) Raw

func (n *Node) Raw() selector.Node

func (*Node) Weight

func (n *Node) Weight() (weight float64)

Weight is node effective weight.

Jump to

Keyboard shortcuts

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