k6runner

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBuggyRunner = errors.New("runner returned buggy response")
	ErrFromRunner  = errors.New("runner reported an error")
)
View Source
var ErrUnexpectedStatus = errors.New("unexpected status code")

Functions

This section is empty.

Types

type HttpRunner

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

func (HttpRunner) Run

func (r HttpRunner) Run(ctx context.Context, script []byte) (*RunResponse, error)

func (HttpRunner) WithLogger

func (r HttpRunner) WithLogger(logger *zerolog.Logger) Runner

type LocalRunner

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

func (LocalRunner) Run

func (r LocalRunner) Run(ctx context.Context, script []byte) (*RunResponse, error)

func (LocalRunner) WithLogger

func (r LocalRunner) WithLogger(logger *zerolog.Logger) Runner

type RunRequest

type RunRequest struct {
	Script   []byte   `json:"script"`
	Settings Settings `json:"settings"`
}

type RunResponse

type RunResponse struct {
	Error     string `json:"error,omitempty"`
	ErrorCode string `json:"errorCode,omitempty"`
	Metrics   []byte `json:"metrics"`
	Logs      []byte `json:"logs"`
}

type Runner

type Runner interface {
	WithLogger(logger *zerolog.Logger) Runner
	Run(ctx context.Context, script []byte) (*RunResponse, error)
}

func New

func New(opts RunnerOpts) Runner

type RunnerOpts added in v0.22.0

type RunnerOpts struct {
	Uri           string
	BlacklistedIP string
}

type Script

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

func NewScript

func NewScript(script []byte, k6runner Runner) (*Script, error)

func (Script) Run

func (r Script) Run(ctx context.Context, registry *prometheus.Registry, logger logger.Logger, internalLogger zerolog.Logger) (bool, error)

type Settings added in v0.19.0

type Settings struct {
	Timeout int64 `json:"timeout"`
}

Jump to

Keyboard shortcuts

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