ewma

package
v0.0.0-...-9a2c5cd Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package ewma (Exponentially-Weighted Moving Average) maintain a moving average of each replica’s round-trip time, weighted by the number of outstanding requests, and distribute traffic to replicas where that cost function is smallest.

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 {
	registry.Node
	// contains filtered or unexported fields
}

Node is endpoint instance

func (*Node) Pick

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

Pick pick a node.

func (*Node) PickElapsed

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

func (*Node) Raw

func (n *Node) Raw() registry.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