js

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2017 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDefaultExport = errors.New("you must export a 'default' function")

Functions

func Check

func Check(val, arg0 otto.Value) (bool, error)

Types

type HTTPParams added in v0.6.0

type HTTPParams struct {
	Headers map[string]string `json:"headers"`
	Tags    map[string]string `json:"tags"`
}

type HTTPResponse

type HTTPResponse struct {
	Status int
}

type InitAPI

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

func (*InitAPI) NewMetric

func (i *InitAPI) NewMetric(it int, name string, isTime bool) *stats.Metric

func (*InitAPI) Open added in v0.8.2

func (i *InitAPI) Open(name string) string

func (*InitAPI) Require

func (i *InitAPI) Require(name string) otto.Value

type JSAPI

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

func (JSAPI) DoCheck

func (a JSAPI) DoCheck(obj otto.Value, conds map[string]otto.Value, extraTags map[string]string) bool

func (JSAPI) DoGroup

func (a JSAPI) DoGroup(call otto.FunctionCall) otto.Value

func (JSAPI) ElapsedMs

func (a JSAPI) ElapsedMs() float64

func (JSAPI) HTMLParse

func (a JSAPI) HTMLParse(src string) *goquery.Selection

func (JSAPI) HTMLSelectionAddSelection

func (a JSAPI) HTMLSelectionAddSelection(vA, vB otto.Value) *goquery.Selection

func (JSAPI) HTTPRequest

func (a JSAPI) HTTPRequest(method, url, body string, paramData string) map[string]interface{}

func (JSAPI) Log

func (a JSAPI) Log(level int, msg string, args []otto.Value)

func (JSAPI) MetricAdd

func (a JSAPI) MetricAdd(m *stats.Metric, v float64, tags map[string]string)

func (JSAPI) Sleep

func (a JSAPI) Sleep(secs float64)

type Runner

type Runner struct {
	Runtime      *Runtime
	DefaultGroup *lib.Group
	Options      lib.Options

	HTTPTransport *http.Transport
}

func NewRunner

func NewRunner(rt *Runtime, exports otto.Value) (*Runner, error)

func (*Runner) ApplyOptions

func (r *Runner) ApplyOptions(opts lib.Options)

func (*Runner) GetDefaultGroup added in v0.5.0

func (r *Runner) GetDefaultGroup() *lib.Group

func (*Runner) GetOptions

func (r *Runner) GetOptions() lib.Options

func (*Runner) NewVU

func (r *Runner) NewVU() (lib.VU, error)

type Runtime

type Runtime struct {
	VM      *otto.Otto
	Exports map[string]otto.Value
	Metrics map[string]*stats.Metric
	Options lib.Options
	// contains filtered or unexported fields
}

func New

func New() (*Runtime, error)

func (*Runtime) Load

func (r *Runtime) Load(filename string) (otto.Value, error)

type VU

type VU struct {
	ID       int64
	IDString string
	Samples  []stats.Sample

	HTTPClient *http.Client
	CookieJar  *lib.CookieJar
	// contains filtered or unexported fields
}

func (*VU) Reconfigure

func (u *VU) Reconfigure(id int64) error

func (*VU) RunOnce

func (u *VU) RunOnce(ctx context.Context) ([]stats.Sample, error)

Jump to

Keyboard shortcuts

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