roundrobin
v1.51.4
Documentation
pkg.go.dev ↗Package roundrobin contains helper functions to check for roundrobin and weighted-roundrobin load balancing of RPCs in tests.
Functions
CheckRoundRobinRPCs
func CheckRoundRobinRPCs(ctx context.Context, client testgrpc.TestServiceClient, addrs []resolver.Address) error
CheckRoundRobinRPCs verifies that EmptyCall RPCs on the given ClientConn, connected to a server exposing the test.grpc_testing.TestService, are roundrobined across the given backend addresses.
Returns a non-nil error if context deadline expires before RPCs start to get roundrobined across the given backends.
CheckWeightedRoundRobinRPCs
func CheckWeightedRoundRobinRPCs(ctx context.Context, client testgrpc.TestServiceClient, addrs []resolver.Address) error
CheckWeightedRoundRobinRPCs verifies that EmptyCall RPCs on the given ClientConn, connected to a server exposing the test.grpc_testing.TestService, are weighted roundrobined (with randomness) across the given backend addresses.
Returns a non-nil error if context deadline expires before RPCs start to get roundrobined across the given backends.