MCPcopy
hub / github.com/grpc/grpc-go / getJitter

Function getJitter

internal/transport/http2_server.go:1487–1495  ·  view source on GitHub ↗
(v time.Duration)

Source from the content-addressed store, hash-verified

1485}
1486
1487func getJitter(v time.Duration) time.Duration {
1488 if v == infinity {
1489 return 0
1490 }
1491 // Generate a jitter between +/- 10% of the value.
1492 r := int64(v / 10)
1493 j := rand.Int64N(2*r) - r
1494 return time.Duration(j)
1495}
1496
1497type connectionKey struct{}
1498

Callers 1

NewServerTransportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected