import "google.golang.org/grpc/benchmark"
Package benchmark implements the building blocks to setup end-to-end gRPC benchmarks.
AddOne add 1 to the features slice
func DoByteBufStreamingRoundTrip(stream testpb.BenchmarkService_StreamingCallClient, reqSize, respSize int) error
DoByteBufStreamingRoundTrip performs a round trip for a single streaming rpc, using a custom codec for byte buffer.
func DoStreamingRoundTrip(stream testpb.BenchmarkService_StreamingCallClient, reqSize, respSize int) error
DoStreamingRoundTrip performs a round trip for a single streaming rpc.
func DoUnaryCall(tc testpb.BenchmarkServiceClient, reqSize, respSize int) error
DoUnaryCall performs an unary RPC with given stub and request and response sizes.
func NewClientConn(addr string, opts ...grpc.DialOption) *grpc.ClientConn
NewClientConn creates a gRPC client connection to addr.
func NewClientConnWithContext(ctx context.Context, addr string, opts ...grpc.DialOption) *grpc.ClientConn
NewClientConnWithContext creates a gRPC client connection to addr using ctx.
NewPayload creates a payload with the given type and size.
func StartServer(info ServerInfo, opts ...grpc.ServerOption) func()
StartServer starts a gRPC server serving a benchmark service according to info. It returns a function to stop the server.
type ServerInfo struct { // Type is the type of the server. // It should be "protobuf" or "bytebuf". Type string // Metadata is an optional configuration. // For "protobuf", it's ignored. // For "bytebuf", it should be an int representing response size. Metadata interface{} // Listener is the network listener for the server to use Listener net.Listener }
ServerInfo contains the information to create a gRPC benchmark server.
Path | Synopsis |
---|---|
benchmain | Package main provides benchmark with setting flags. |
benchresult | To format the benchmark result: go run benchmark/benchresult/main.go resultfile |
client | |
grpc_testing | |
latency | Package latency provides wrappers for net.Conn, net.Listener, and net.Dialers, designed to interoperate to inject real-world latency into network connections. |
server | |
stats | |
worker |
Package benchmark imports 15 packages (graph) and is imported by 87 packages. Updated 2019-01-13. Refresh now. Tools for package owners.