types

package
v0.0.0-...-b2a4aae Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointSliceGroup

type EndpointSliceGroup struct {
	// Label is a unique identifier for an EndpointSliceGroup. This often
	// represents a topology label that the group will be consumed from.
	Label string
	// Composition stores contribution of endpoints in this group from different
	// zones
	Composition map[string]WeightedEndpoints
	// ZoneTrafficWeights this sliceGroup has for requests from different zones
	ZoneTrafficWeights map[string]float64
}

EndpointSliceGroup represents all the EndpointSlices under a same label, one group may be made up by many EndpointSlices (when the number of endpoints excceeds the capacity of one EndpointSlice). Since for now there is no need to know how the group is composed, we keep them as a whole

func (EndpointSliceGroup) NumberOfEndpoints

func (e EndpointSliceGroup) NumberOfEndpoints() int

NumberOfEndpoints calculates number of endpoints of a specific EndpointSliceGroup

func (EndpointSliceGroup) NumberOfWeightedEndpoints

func (e EndpointSliceGroup) NumberOfWeightedEndpoints() float64

NumberOfWeightedEndpoints calculates weighted number of endpoints of a specific EndpointSliceGroup

type EndpointsTraffic

type EndpointsTraffic struct {
	// EndpointsTrafficLoad for different endpoints belong to a zone in
	// different sliceGroups
	// key: sliceGroup label endpoints assigned to
	EndpointsTrafficLoad map[string]float64
	// EndpointsTrafficLoadDeviation for different endpoints belong to a zone
	// in different sliceGroups
	// key: sliceGroup label endpoints assigned to
	EndpointsTrafficLoadDeviation map[string]float64
	// MaxDeviationSG (SG:sliceGroup) of endpoints in a zone
	MaxDeviationSG string
	// MeanDeviation of endpoints in a zone
	MeanDeviation float64
}

EndpointsTraffic stores traffic load details of endpoints in a zone

type RegionInfo

type RegionInfo struct {
	// TotalNodes of all zones
	TotalNodes int
	// TotalEndpoints of all zones
	TotalEndpoints int
	// ZoneDetails by zone
	ZoneDetails map[string]Zone
}

RegionInfo wraps information of zones in a region

func CreateRegionInfo

func CreateRegionInfo(zones []Zone) (RegionInfo, error)

CreateRegionInfo creates regionInfo with zone infos

type SimulationResult

type SimulationResult struct {
	// Invalid if something ends up with unexpected errors, i.e. some zones have
	// no endpoints to send traffic to, illegal routing weights (weights < 0)
	// etc.
	Invalid bool
	// InZoneTraffic is the total ratio of traffic that stays in the same zone
	InZoneTraffic float64
	// TrafficDistribution groups zoneTraffic by zone name
	TrafficDistribution map[string]ZoneTraffic
	// MaxDeviation of traffic load of all endpoints
	MaxDeviation float64
	// MeanDeviation of traffic load of all endpoints
	MeanDeviation float64
	// DeviationSD represents the standard deviation of the daviation of traffic
	// load across all endpoints
	DeviationSD float64
}

SimulationResult is to collect metrics of a simulation result

type WeightedEndpoints

type WeightedEndpoints struct {
	// Number of endpoints
	Number int
	// Weight of these endpoints when routing in a slice
	Weight float64
}

WeightedEndpoints are used to do routing inside an EndpointSliceGroup

type Zone

type Zone struct {
	// Nodes is the numer of nodes of this zone
	Nodes int
	// Endpoints is the Number of endpoints in this zone
	Endpoints int
	// Name of this zone
	Name string
	// EndpointsRatio of this zone compared to all endpoints
	EndpointsRatio float64
	// NodesRatio of this zone compared to all nodes
	NodesRatio float64
}

Zone abstracts the conception of 'zone' in clouds

type ZoneTraffic

type ZoneTraffic struct {
	// ZoneName of a specific zone
	ZoneName string
	// Incoming traffic this zone received
	Incoming float64
	// Outgoing traffic distribution of this zone
	Outgoing map[string]float64
	// TrafficLoad: ratio between exact traffic received by the zone and its
	// expected receiving traffic
	TrafficLoad float64
	// ZoneTrafficDetail stores detailed traffic load information for all
	// endpoints in the zone
	ZoneTrafficDetail EndpointsTraffic
}

ZoneTraffic records the detailed traffic infomation of a zone

Jump to

Keyboard shortcuts

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