k6

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: AGPL-3.0 Imports: 10 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 ErrCheckInInitContext = common.NewInitContextError("Using check() in the init context is not supported")

ErrCheckInInitContext is returned when check() are using in the init context.

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

ErrGroupInInitContext is returned when group() are using in the init context.

Functions

This section is empty.

Types

type K6

type K6 struct{}

K6 is just the module struct.

func New added in v0.18.0

func New() *K6

New returns a new module Struct.

func (*K6) Check

func (*K6) Check(ctx context.Context, arg0, checks goja.Value, extras ...goja.Value) (bool, error)

Check will emit check metrics for the provided checks.

func (*K6) Fail

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

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

func (*K6) Group

func (*K6) Group(ctx context.Context, name string, fn goja.Callable) (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 (*K6) RandomSeed(ctx context.Context, seed int64)

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

func (*K6) Sleep

func (*K6) Sleep(ctx context.Context, secs float64)

Sleep waits the provided seconds before continuing the execution.

Directories

Path Synopsis
generated by js/modules/k6/html/gen/gen_elements.go directed by js/modules/k6/html/elements.go; DO NOT EDIT nolint: goconst
generated by js/modules/k6/html/gen/gen_elements.go directed by js/modules/k6/html/elements.go; DO NOT EDIT nolint: goconst
gen

Jump to

Keyboard shortcuts

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