stress

package
v0.0.0-...-055e899 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rotbot

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

func (*Rotbot) Close

func (r *Rotbot) Close()

func (*Rotbot) GetReady

func (r *Rotbot) GetReady() error

type Schduler

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

func NewScheduler

func NewScheduler(o ScheduleOption) *Schduler

func (*Schduler) ProduceTPS

func (s *Schduler) ProduceTPS(task Task)

type ScheduleOption

type ScheduleOption struct {
	Workers         int
	RobotsPerWorker int

	Interval time.Duration
	Timeout  time.Duration

	ClientFactory func() *client.Client
}

type SimpleTask

type SimpleTask struct{}

func (*SimpleTask) Do

func (t *SimpleTask) Do(robot *Rotbot, iteration int) error

type Task

type Task interface {
	Do(robot *Rotbot, iteration int) error
}

type Worker

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

Worker uses separate goroutine to do work with specified robots.

func (*Worker) Add

func (w *Worker) Add(r *Rotbot)

func (*Worker) Close

func (w *Worker) Close()

func (*Worker) Init

func (w *Worker) Init() error

func (*Worker) Repeat

func (w *Worker) Repeat(
	ctx context.Context, interval time.Duration, task Task, wg *sync.WaitGroup)

Repeat repeatly do work with the specified task.

Jump to

Keyboard shortcuts

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