Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveMethod ¶
func ResolveMethod(cfg *Config, conn *grpc.ClientConn) (protoreflect.MethodDescriptor, error)
ResolveMethod returns the MethodDescriptor for the configured service/method. It loads from a .proto file when cfg.ProtoFile is set; otherwise it queries the server's reflection service using the provided connection.
func RunAttack ¶
func RunAttack(cfg *Config, stopCh chan struct{}, metrics *attack.GlobalMetrics) (*attack.GlobalMetrics, time.Duration, error)
RunAttack runs a gRPC unary load test and returns the collected metrics. It accepts a pre-created metrics object so the server can stream live updates.
Types ¶
type Config ¶
type Config struct {
// Target is the gRPC server address in host:port format.
Target string
// Service is the fully qualified service name, e.g. "helloworld.Greeter".
Service string
// Method is the RPC method name, e.g. "SayHello".
Method string
// ProtoFile is an optional path to a .proto source file.
// When empty, server reflection is used instead.
ProtoFile string
// Data is the JSON-encoded request payload. Defaults to "{}".
Data string
// Metadata is a list of "key:value" strings sent as gRPC metadata.
Metadata []string
// Insecure disables TLS verification (useful for local testing).
Insecure bool
// CACert is an optional path to a PEM-encoded CA certificate for TLS.
CACert string
Duration time.Duration
Timeout time.Duration
Workers uint
Connections uint // number of gRPC channels in the pool
RPS int
Output string
}
Config holds all parameters for a gRPC load test.
Click to show internal directories.
Click to hide internal directories.