lt

package
v0.0.0-...-85902bd Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReporter

func NewReporter() processor.Reporter

NewReporter creates a reporter

func Run

func Run(options *Options)

Run runs a load tests

Types

type Config

type Config struct {
	processor.Config
	Model           string
	Hostname        string
	Port            int
	CacheSize       int
	Fields          []*Field
	NewResponseData func() interface{}
}

Config represents load testing config

func NewConfigFromURL

func NewConfigFromURL(ctx context.Context, URL string) (*Config, error)

NewConfigFromURL creates a config from URL

func (*Config) Init

func (c *Config) Init(ctx context.Context, fs afs.Service) error

Init initialises config

func (*Config) Validate

func (c *Config) Validate() error

Validate validates config

type Field

type Field struct {
	Name string
	Type string
}

Field represents

type Options

type Options struct {
	ConfigURL string `short:"c" long:"config" description:"config url"`
	DataFile  string `short:"d" long:"data" description:"data location"`
	Repeat    int    `short:"r" long:"repeat" description:"repeat"`
}

Options represents load testing options

type Processor

type Processor struct {
	*Config
}

Processor represents load testing processor

func (*Processor) Post

func (p *Processor) Post(ctx context.Context, reporter processor.Reporter) error

Post runs post processing logic

func (*Processor) Pre

func (p *Processor) Pre(ctx context.Context, reporter processor.Reporter) (context.Context, error)

Pre runs preprocessing logic

func (*Processor) Process

func (p *Processor) Process(ctx context.Context, data []byte, reporter processor.Reporter) error

Process runs prediction

type Reporter

type Reporter struct {
	processor.BaseReporter

	ServiceTimeMcs int64
	ServiceCount   int32

	ResponseTimeMcs int64
	ResponseCount   int32

	CacheTimeMcs int64
	CacheCount   int32

	AvgServiceTimeMcs  int64
	AvgResponseTimeMcs int64
	AvgCacheTimeMcs    int64
}

Reporter represents load testing reported

Jump to

Keyboard shortcuts

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