Documentation
¶
Index ¶
- type Client
- func (c *Client) AppendBatch(ctx context.Context, batch *protoloadgen.Batch) (*emptypb.Empty, error)
- func (c *Client) GetLimit(context.Context, *emptypb.Empty) (*protoloadgen.Limit, error)
- func (c *Client) RegisterService(server *grpc.Server)
- func (c *Client) Run(ctx context.Context) error
- func (c *Client) SetLimit(_ context.Context, limit *protoloadgen.Limit) (*emptypb.Empty, error)
- func (*Client) WaitForReady(context.Context) bool
- type ClientConfig
- type ServiceAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { protoloadgen.UnimplementedLoadGenServiceServer // contains filtered or unexported fields }
Client for applying load on the services.
func NewLoadGenClient ¶
func NewLoadGenClient(conf *ClientConfig) (*Client, error)
NewLoadGenClient creates a new client instance.
func (*Client) AppendBatch ¶
func (c *Client) AppendBatch(ctx context.Context, batch *protoloadgen.Batch) (*emptypb.Empty, error)
AppendBatch appends a batch to the stream.
func (*Client) RegisterService ¶ added in v0.1.5
RegisterService registers for the load-gen's GRPC services.
type ClientConfig ¶
type ClientConfig struct { Server *connection.ServerConfig `mapstructure:"server"` Monitoring metrics.Config `mapstructure:"monitoring" yaml:"monitoring"` Adapter adapters.AdapterConfig `mapstructure:",squash" yaml:",inline"` Stream *workload.StreamOptions `mapstructure:"stream" yaml:"stream"` LoadProfile *workload.Profile `mapstructure:"load-profile" yaml:"load-profile"` Limit *adapters.GenerateLimit `mapstructure:"limit" yaml:"limit"` // Generate If omitted, all phases will be generated by default. Generate adapters.Phases `mapstructure:"generate" yaml:"generate"` }
ClientConfig is a struct that contains the configuration for the client.
func DefaultClientConf ¶
func DefaultClientConf() *ClientConfig
DefaultClientConf returns default config values for client testing.
type ServiceAdapter ¶
type ServiceAdapter interface { // RunWorkload apply the generated workload. RunWorkload(ctx context.Context, txStream *workload.StreamWithSetup) error // Progress returns a value that indicates progress as the number grows. Progress() uint64 // Supports specify which phases an adapter supports. Supports() adapters.Phases }
ServiceAdapter encapsulates the common interface for adapters.
Click to show internal directories.
Click to hide internal directories.