js

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2017 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricReqs          = stats.New("http_reqs", stats.Counter)
	MetricReqDuration   = stats.New("http_req_duration", stats.Trend, stats.Time)
	MetricReqBlocked    = stats.New("http_req_blocked", stats.Trend, stats.Time)
	MetricReqLookingUp  = stats.New("http_req_looking_up", stats.Trend, stats.Time)
	MetricReqConnecting = stats.New("http_req_connecting", stats.Trend, stats.Time)
	MetricReqSending    = stats.New("http_req_sending", stats.Trend, stats.Time)
	MetricReqWaiting    = stats.New("http_req_waiting", stats.Trend, stats.Time)
	MetricReqReceiving  = stats.New("http_req_receiving", stats.Trend, stats.Time)
)
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) 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(call otto.FunctionCall) otto.Value

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)

func (JSAPI) Taint

func (a JSAPI) Taint()

type Runner

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

	HTTPTransport *http.Transport
}

func NewRunner

func NewRunner(runtime *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
	Taint    bool

	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