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 ErrNoTimeout = errors.New("check has no timeout")
ErrNoTimeout is returned by Runner implementations if the supplied script has a timeout of zero.
View Source
var ErrUnexpectedStatus = errors.New("unexpected status code")
Functions ¶
This section is empty.
Types ¶
type CheckInfo ¶ added in v0.29.0
type CheckInfo struct { // Type is the string representation of the check type this script belongs to (browser, scripted, multihttp, etc.) Type string `json:"type"` // Metadata is a collection of key/value pairs containing information about this check, such as check and tenant ID. // It is loosely typed on purpose: Metadata should only be used for informational properties that will make its way // into telemetry, and not for making decision on it. Metadata map[string]any `json:"metadata"` }
CheckInfo holds information about the SM check that triggered this script.
func CheckInfoFromSM ¶ added in v0.29.0
CheckInfoFromSM returns a CheckInfo from the information of the given SM check.
type HTTPRunRequest ¶ added in v0.28.1
HTTPRunRequest
type HttpRunner ¶
type HttpRunner struct {
// contains filtered or unexported fields
}
func (HttpRunner) Run ¶
func (r HttpRunner) Run(ctx context.Context, script Script) (*RunResponse, error)
func (HttpRunner) WithLogger ¶
func (r HttpRunner) WithLogger(logger *zerolog.Logger) Runner
type Local ¶ added in v0.28.2
type Local struct {
// contains filtered or unexported fields
}
type Processor ¶ added in v0.24.3
type Processor struct {
// contains filtered or unexported fields
}
Processor runs a script with a runner and parses the k6 output.
func NewProcessor ¶ added in v0.24.3
type RunResponse ¶
type Runner ¶
type Runner interface { WithLogger(logger *zerolog.Logger) Runner Run(ctx context.Context, script Script) (*RunResponse, error) }
func New ¶
func New(opts RunnerOpts) Runner
type RunnerOpts ¶ added in v0.22.0
type Script ¶
type Script struct { // Script is the blob of bytes that is to be run. Script []byte `json:"script"` // Settings is a common representation of the fields common to all implementation-specific check settings that the // runners are interested about. Settings Settings `json:"settings"` // CheckInfo holds information about the SM check that triggered this script. CheckInfo CheckInfo `json:"check"` }
Script is a k6 script that a runner is able to run, with some added instructions for that runner to act on.
type Settings ¶ added in v0.19.0
type Settings struct { // Timeout for k6 run, in milliseconds. This value is a configuration value for remote runners, which will instruct // them to return an error if the operation takes longer than this time to complete. Clients should expect that // requests to remote runners may take longer than this value due to network and other latencies, and thus clients // should wait additional time before aborting outgoing requests. Timeout int64 `json:"timeout"` }
Settings is a common representation of the fields common to all implementation-specific check settings that the runners are interested about.
Click to show internal directories.
Click to hide internal directories.