loadrunner

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Run() error
}

Command represents something that can be run by the load runner

type CommandFactory

type CommandFactory interface {

	// Name returns the name of the command
	Name() string

	// CreateCommand creates a Command instance
	CreateCommand(loadRunnerNodeID int, commandConfig string) Command
}

CommandFactory creates Command instances given some config Each command type has its own CommandFactory instance

type Config

type Config struct {
	NodeID                   int
	APIServerListenAddresses []string
}

Config represents configuration for the load runner

func (*Config) Validate

func (c *Config) Validate() error

type ExecStatementCommand

type ExecStatementCommand struct {
	// contains filtered or unexported fields
}

ExecStatementCommand is a Command that executes Prana statements (e.g. SELECT statements, or DDL statements like CREATE SOURCE) against Prana

func (*ExecStatementCommand) Run

func (p *ExecStatementCommand) Run() error

type ExecStatementCommandFactory

type ExecStatementCommandFactory struct {
}

ExecStatementCommandFactory is a CommandFactory instance that creates ExecuteStatementCommand instances

func (*ExecStatementCommandFactory) CreateCommand

func (p *ExecStatementCommandFactory) CreateCommand(loadRunnerNodeID int, commandString string) Command

func (*ExecStatementCommandFactory) Name

type ExecuteStatementCommandCfg

type ExecuteStatementCommandCfg struct {
	// LoadRunnerNodeID is the ID of the load runner node from where to execute this statement
	LoadRunnerNodeID int `json:"load_runner_node_id"`
	// NumIters is the number of times to execute the statement
	NumIters int `json:"num_iters"`
	// Concurrency determines the number of goroutines that will be created to execute the statements. Each
	// goroutine executes the statement numIters times
	Concurrency int `json:"concurrency"`
	// The gRPC API host_name of the Prana server to execute the statement on
	PranaHostname string `json:"prana_host_name"`
	// SchemaName is the schema name
	SchemaName string `json:"schema_name"`
	// Statement is the statement to execute
	Statement string `json:"statement"`
}

type LoadRunner

type LoadRunner struct {
	// contains filtered or unexported fields
}

LoadRunner is a simple server which hosts a gRPC API and allows commands to be executed. Commands are described by JSON and can be things like sending messages to Kafka or executing Prana DML or DDL statements against a Prana server. Load runner is deployed as a cluster and there's a simple command line client that's used to send commands to it.

func NewLoadRunner

func NewLoadRunner(conf Config) *LoadRunner

func (*LoadRunner) RunCommand

func (p *LoadRunner) RunCommand(ctx context.Context, request *loadrunner.RunCommandRequest) (*emptypb.Empty, error)

func (*LoadRunner) Start

func (p *LoadRunner) Start() error

func (*LoadRunner) Stop

func (p *LoadRunner) Stop() error

type PublishCommand

type PublishCommand struct {
	// contains filtered or unexported fields
}

PublishCommand is a command which publishes messages Kafka using a message generator

func (*PublishCommand) Run

func (p *PublishCommand) Run() error

type PublishCommandCfg

type PublishCommandCfg struct {
	// GeneratorName is the name of the generator which actually creates the Kafka messages
	GeneratorName string `json:"generator_name"`
	// TopicName is the name of the topic to send the messages to
	TopicName string `json:"topic_name"`
	// Partitions is the number of partitions in the topic
	Partitions int `json:"partitions"`
	// Delay is the delay between sending each message
	Delay time.Duration `json:"delay"`
	// NumMessages is the total number of messages to send
	NumMessages int64 `json:"num_messages"`
	// IndexStart determines the start ID of the first message sent
	IndexStart int64 `json:"index_start"`
	// KafkaProperties - properties when making the connection to Kafka
	KafkaProperties map[string]string `json:"kafka_properties"`
}

type PublishCommandFactory

type PublishCommandFactory struct {
}

func (*PublishCommandFactory) CreateCommand

func (p *PublishCommandFactory) CreateCommand(loadRunnerNodeID int, commandConfig string) Command

func (*PublishCommandFactory) Name

func (p *PublishCommandFactory) Name() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL