INNER CODE UNIT · Go
muLn
bhope/hedge · benchmark/simulate/main.go:40
muLn = math.Log(meanNs) - sigmaLn*sigmaLn/2
}
func sampleLatency() time.Duration {
base := time.Duration(math.Exp(muLn + sigmaLn*rand.NormFloat64()))
if rand.Float64() < stragglerP {
return time.Duration(float64(base) * stragglerMul)
}
return base
}
type simResult struct {
latencies []time.Duration
overhead float64
}
func runSim(transport http.RoundTripper, serverHits *atomic.Int64, url string) simResult {
before := serverHits.Load()