MCPcopy Create free account
hub / github.com/zalando/skipper / newRandom

Function newRandom

loadbalancer/algorithm.go:80–85  ·  view source on GitHub ↗
(endpoints []string)

Source from the content-addressed store, hash-verified

78}
79
80func newRandom(endpoints []string) routing.LBAlgorithm {
81 // #nosec
82 return &random{
83 rnd: rand.New(rand.NewPCG(uint64(time.Now().UnixNano()), 0)),
84 }
85}
86
87// Apply implements routing.LBAlgorithm with a stateless random algorithm.
88func (r *random) Apply(ctx *routing.LBContext) routing.LBEndpoint {

Callers 2

TestApplyFunction · 0.85
BenchmarkRandomAlgorithmFunction · 0.85

Calls 1

NewMethod · 0.80

Tested by 2

TestApplyFunction · 0.68
BenchmarkRandomAlgorithmFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…