loadgen

package
v0.0.0-...-b3fc11c Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MessageOpen = []string{
		"aloha",
		"bonjour",
		"cool news today",
		"good morning",
		"hey friends",
	}
	MessageBody = []string{
		"apples taste good!",
		"bananas are yellow",
		"cedar trees grow large",
		"darkness happens at night",
		"eureka, I wrote a readme",
	}
	MessageClose = []string{
		"au revoir",
		"bye",
		"check ya later",
		"farewell",
		"goodbye",
		"hasta la vista",
		"later, taters",
		"so long",
	}
)
View Source
var (
	FirstNames = []string{
		"Aziz",
		"Bob",
		"Corina",
		"Desmond",
		"Eric",
		"Frank",
		"Georgette",
		"Harvey",
		"Iris",
		"Julie",
		"Kelly",
		"Larry",
		"Monique",
		"Natalie",
		"Othello",
		"Pierre",
		"Quincy",
		"Raymondette",
		"Sarah",
		"Timmy",
		"Ulysses",
		"Virginia",
		"Will",
		"Xerxes",
		"Yannick",
		"Zebulon",
	}
	MiddleNames = []string{
		"Aardvark",
		"Crocodile",
		"Duck",
		"Groundhog",
		"Marmot",
		"Otter",
		"Squirrel",
	}
	LastNames = []string{
		"Aaronson",
		"Black",
		"White",
		"Xanthos",
		"Yastrzemski",
		"Zaborowski",
	}
)

Functions

func Cli

func Cli(client *webserver.Client, config *Config)

func GenerateMessages

func GenerateMessages(ctx context.Context, stamp int) <-chan string

func GenerateUsers

func GenerateUsers(ctx context.Context, stamp int) <-chan [2]string

Types

type Config

type Config struct {
	Mode              string
	Workers           int
	PauseMilliseconds int
}

type Generator

type Generator struct {
	Client  *webserver.Client
	Actions chan func()
	UserIds []uuid.UUID
}

func NewGenerator

func NewGenerator(ctx context.Context, client *webserver.Client) *Generator

func (*Generator) CreateMessages

func (g *Generator) CreateMessages(ctx context.Context, userId uuid.UUID, messages <-chan string, count int)

func (*Generator) CreateUsers

func (g *Generator) CreateUsers(ctx context.Context, limit int)

type MessageState

type MessageState struct {
	Open      int
	Middle    int
	Close     int
	Iteration int
	Stamp     int
}

func (*MessageState) GetMessage

func (m *MessageState) GetMessage() string

func (*MessageState) Increment

func (m *MessageState) Increment()

type NameState

type NameState struct {
	First     int
	Middle    int
	Last      int
	Iteration int
	Stamp     int
}

func (*NameState) GetName

func (n *NameState) GetName() [2]string

func (*NameState) Increment

func (n *NameState) Increment()

Jump to

Keyboard shortcuts

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