Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

roundrobin

v1.51.4
github.com/lfch/grpc/internal/testutils/roundrobin

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

3 matches

Top ↑

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.

Dependency graph