Movatterモバイル変換


[0]ホーム

URL:


benchmark

package
v1.77.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2025 License:Apache-2.0Imports:14Imported by:841

Details

Repository

github.com/grpc/grpc-go

Links

Documentation

Overview

Package benchmark implements the building blocks to setup end-to-end gRPC benchmarks.

Index

Constants

View Source
const PreloadMsgSizeHeader = "preload-msg-size"

PreloadMsgSizeHeader indicates that the client is going to ask fora fixed response size and passes this size to the server.The server is expected to preload the response on startup.

View Source
const UnconstrainedStreamingDelayHeader = "unconstrained-streaming-delay"

UnconstrainedStreamingDelayHeader is used to pass the maximum amount of timethe server should sleep between consecutive RPC responses.

View Source
const UnconstrainedStreamingHeader = "unconstrained-streaming"

UnconstrainedStreamingHeader indicates to the StreamingCall handler that itsbehavior should be unconstrained (constant send/receive in parallel) insteadof ping-pong.

Variables

This section is empty.

Functions

funcDoByteBufStreamingRoundTrip

func DoByteBufStreamingRoundTrip(streamtestgrpc.BenchmarkService_StreamingCallClient, reqSize, _int)error

DoByteBufStreamingRoundTrip performs a round trip for a single streaming rpc, using a custom codec for byte buffer.

funcDoStreamingRoundTrip

func DoStreamingRoundTrip(streamtestgrpc.BenchmarkService_StreamingCallClient, reqSize, respSizeint)error

DoStreamingRoundTrip performs a round trip for a single streaming rpc.

funcDoStreamingRoundTripPreloadedadded inv1.57.0

func DoStreamingRoundTripPreloaded(streamtestgrpc.BenchmarkService_StreamingCallClient, reqany)error

DoStreamingRoundTripPreloaded performs a round trip for a single streaming rpc with preloaded payload.

funcDoUnaryCall

func DoUnaryCall(tctestgrpc.BenchmarkServiceClient, reqSize, respSizeint)error

DoUnaryCall performs a unary RPC with given stub and request and response sizes.

funcNewClientConn

func NewClientConn(addrstring, opts ...grpc.DialOption) *grpc.ClientConn

NewClientConn creates a gRPC client connection to addr.

funcNewClientConnWithContextadded inv1.13.0

func NewClientConnWithContext(_context.Context, addrstring, opts ...grpc.DialOption) *grpc.ClientConn

NewClientConnWithContext creates a gRPC client connection to addr using ctx.

funcNewPayloadadded inv1.18.0

func NewPayload(ttestpb.PayloadType, sizeint) *testpb.Payload

NewPayload creates a payload with the given type and size.

funcStartServer

func StartServer(infoServerInfo, opts ...grpc.ServerOption) func()

StartServer starts a gRPC server serving a benchmark service according to info.It returns a function to stop the server.

Types

typeServerInfo

type ServerInfo struct {// Type is the type of the server.// It should be "protobuf" or "bytebuf".Typestring// Metadata is an optional configuration.// For "protobuf", it's ignored.// For "bytebuf", it should be an int representing response size.Metadataany// Listener is the network listener for the server to useListenernet.Listener}

ServerInfo contains the information to create a gRPC benchmark server.

Source Files

View all Source files

Directories

PathSynopsis
Package main provides benchmark with setting flags.
Package main provides benchmark with setting flags.
To format the benchmark result:
To format the benchmark result:
Package main provides a client used for benchmarking.
Package main provides a client used for benchmarking.
Package flags provide convenience types and routines to accept specific types of flag values on the command line.
Package flags provide convenience types and routines to accept specific types of flag values on the command line.
Package latency provides wrappers for net.Conn, net.Listener, and net.Dialers, designed to interoperate to inject real-world latency into network connections.
Package latency provides wrappers for net.Conn, net.Listener, and net.Dialers, designed to interoperate to inject real-world latency into network connections.
Package main provides a server used for benchmarking.
Package main provides a server used for benchmarking.
Package stats tracks the statistics associated with benchmark runs.
Package stats tracks the statistics associated with benchmark runs.
Binary worker implements the benchmark worker that can turn into a benchmark client or server.
Binary worker implements the benchmark worker that can turn into a benchmark client or server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp