endpoint

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClusterLoadAssignmentReference

func GetClusterLoadAssignmentReference(cluster *envoy_config_cluster_v3.Cluster) string

func GetClusterLoadAssignmentReferences

func GetClusterLoadAssignmentReferences(clusters []*envoy_config_cluster_v3.Cluster) []string

GetClusterLoadAssignmentReferences returns the ClusterLoadAssignment names that references the provided clusters

func GetLoadBalancingWeight

func GetLoadBalancingWeight(ep *envoy_config_endpoint_v3.LbEndpoint) uint32

func GetLoadDistribution

func GetLoadDistribution(localityLbEndpoints []*envoy_config_endpoint_v3.LocalityLbEndpoints,
	endpointsStats *EndpointsStats, overProvisioningFactor, activeRequestBias float64) map[string]float64

GetLoadDistribution computes the load distribution for healthy endpoints taking into account priority level and locality load distribution If the activeRequestBias is >= 0.0 than adjust effective endpoint weights based on active requests according to the formula described at https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/load_balancers#weighted-least-request

func HasSocketAddress

func HasSocketAddress() *endpointWithSocketAddressFilter

func IsHealthy

IsHealthy returns true if the given endpoint is healthy

func LoadBalancingWeightsAreEqual

func LoadBalancingWeightsAreEqual(endpoints []*envoy_config_endpoint_v3.LocalityLbEndpoints) bool

LoadBalancingWeightsAreEqual returns true if the weights of all the endpoints are equal

func WithHealthyStatus

func WithHealthyStatus() *healthyEndpointFilter

func WithSocketAddress

func WithSocketAddress(address *net.TCPAddr) *endpointWithSocketAddressFilter

Types

type EndpointsStats

type EndpointsStats struct {
	*util.KeyValueCollection[string, *Stats]
}

EndpointsStats stores Stats for a collection of endpoints

func NewEndpointsStats

func NewEndpointsStats() *EndpointsStats

func (*EndpointsStats) ActiveRequestsCount

func (eps *EndpointsStats) ActiveRequestsCount(endpointAddress string) uint32

ActiveRequestsCount returns the number of active requests the endpoint with given address has.

func (*EndpointsStats) DecActiveRequestsCount

func (eps *EndpointsStats) DecActiveRequestsCount(endpointAddress string)

func (*EndpointsStats) IncActiveRequestsCount

func (eps *EndpointsStats) IncActiveRequestsCount(endpointAddress string)

func (*EndpointsStats) IncRoundRobinCount

func (eps *EndpointsStats) IncRoundRobinCount(endpointAddress string)

func (*EndpointsStats) ResetActiveRequestsCount

func (eps *EndpointsStats) ResetActiveRequestsCount(endpointAddress string)

func (*EndpointsStats) ResetRoundRobinCount

func (eps *EndpointsStats) ResetRoundRobinCount(endpointAddress string)

func (*EndpointsStats) RoundRobinCount

func (eps *EndpointsStats) RoundRobinCount(endpointAddress string) uint32

RoundRobinCount returns the number of times the endpoint with the given address was selected by weighted round-robin load balancing

func (*EndpointsStats) SetActiveRequestsCount

func (eps *EndpointsStats) SetActiveRequestsCount(endpointAddress string, activeRequestsCount uint32)

type LbEndpointsFilterOption

type LbEndpointsFilterOption interface {
	Filter(ep *envoy_config_endpoint_v3.LbEndpoint) bool
}

type Stats

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

Stats stores various items related to a service endpoint

func (*Stats) ActiveRequestsCount

func (s *Stats) ActiveRequestsCount() uint32

ActiveRequestsCount returns the number of active requests the endpoint has.

func (*Stats) RoundRobinCount

func (s *Stats) RoundRobinCount() uint32

RoundRobinCount returns the number of times the endpoint was selected by weighted round-robin load balancing

Jump to

Keyboard shortcuts

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