k6

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: AGPL-3.0 Imports: 9 Imported by: 6

Documentation

Overview

Package k6 implements the module imported as 'k6' from inside k6.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrGroupInInitContext is returned when group() are using in the init context.
	ErrGroupInInitContext = common.NewInitContextError("Using group() in the init context is not supported")

	// ErrCheckInInitContext is returned when check() are using in the init context.
	ErrCheckInInitContext = common.NewInitContextError("Using check() in the init context is not supported")
)

Functions

This section is empty.

Types

type K6

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

K6 represents an instance of the k6 module.

func (*K6) Check

func (mi *K6) Check(arg0, checks goja.Value, extras ...goja.Value) (bool, error)

Check will emit check metrics for the provided checks.

func (*K6) Exports added in v0.36.0

func (mi *K6) Exports() modules.Exports

Exports returns the exports of the k6 module.

func (*K6) Fail

func (*K6) Fail(msg string) (goja.Value, error)

Fail is a fancy way of saying `throw "something"`.

func (*K6) Group

func (mi *K6) Group(name string, val goja.Value) (goja.Value, error)

Group wraps a function call and executes it within the provided group name.

func (*K6) RandomSeed added in v0.22.0

func (mi *K6) RandomSeed(seed int64)

RandomSeed sets the seed to the random generator used for this VU.

func (*K6) Sleep

func (mi *K6) Sleep(secs float64)

Sleep waits the provided seconds before continuing the execution.

type RootModule added in v0.36.0

type RootModule struct{}

RootModule is the global module instance that will create module instances for each VU.

func New added in v0.18.0

func New() *RootModule

New returns a pointer to a new RootModule instance.

func (*RootModule) NewModuleInstance added in v0.36.0

func (*RootModule) NewModuleInstance(vu modules.VU) modules.Instance

NewModuleInstance implements the modules.Module interface to return a new instance for each VU.

Directories

Path Synopsis
Package experimental includes experimental module features
Package experimental includes experimental module features
browser
Package browser contains a RootModule wrapper that wraps around the experimental browser RootModule.
Package browser contains a RootModule wrapper that wraps around the experimental browser RootModule.
tracing
Package tracing implements a k6 JS module for instrumenting k6 scripts with tracing context information.
Package tracing implements a k6 JS module for instrumenting k6 scripts with tracing context information.
generated by js/modules/k6/html/gen/gen_elements.go; DO NOT EDIT
generated by js/modules/k6/html/gen/gen_elements.go; DO NOT EDIT
gen
Package http implements the k6/http js module for k6.
Package http implements the k6/http js module for k6.
Package ws implements a k6/ws for k6.
Package ws implements a k6/ws for k6.

Jump to

Keyboard shortcuts

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