http3

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: AGPL-3.0 Imports: 36 Imported by: 0

README

xk6-http3

This is an experiment to implement http3 client as an extension for k6.

Build

xk6 build --with github.com/bandorko/xk6-http3

Usage

Usage of the extension is similar to the k6/http extension

Example
import http3 from 'k6/x/http3'

export default function(){
  let resp = http3.get("https://www.google.com/")
  console.log(resp);
}

QLOG

You can generate the http3 qlog file with the HTTP3_QLOG=1 environment variable

Documentation

Index

Constants

View Source
const (
	HTTP3ReqDurationName  = "http3_req_duration"
	HTTP3ReqSendingName   = "http3_req_sending"
	HTTP3ReqWaitingName   = "http3_req_waiting"
	HTTP3ReqReceivingName = "http3_req_receiving"
	HTTP3ReqsName         = "http3_reqs"
)

Variables

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

ErrBatchForbiddenInInitContext is used when batch was made in the init context

View Source
var ErrHTTPForbiddenInInitContext = common.NewInitContextError("Making http requests in the init context is not supported")

ErrHTTPForbiddenInInitContext is used when a http requests was made in the init context

Functions

func NewTracer added in v0.1.1

func NewTracer(vu modules.VU, http3Metrics *HTTP3Metrics) *logging.ConnectionTracer

Types

type Client

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

func (*Client) Request

func (c *Client) Request(method string, url goja.Value, args ...goja.Value) (*Response, error)

Request makes an http request of the provided `method` and returns a corresponding response by taking goja.Values as arguments

type FileData

type FileData struct {
	Data        []byte
	Filename    string
	ContentType string
}

FileData represents a binary file requiring multipart request encoding

type HTTP3Metrics added in v0.1.1

type HTTP3Metrics struct {
	HTTP3ReqDuration  *metrics.Metric
	HTTP3ReqSending   *metrics.Metric
	HTTP3ReqWaiting   *metrics.Metric
	HTTP3ReqReceiving *metrics.Metric
	HTTP3Reqs         *metrics.Metric
}

func RegisterMetrics added in v0.1.1

func RegisterMetrics(vu modules.VU) (*HTTP3Metrics, error)

type ModuleInstance

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

func (*ModuleInstance) Exports

func (mi *ModuleInstance) Exports() modules.Exports

type Response

type Response struct {
	*httpext.Response `js:"-"`
	// contains filtered or unexported fields
}

type RootModule

type RootModule struct{}

func New

func New() *RootModule

func (*RootModule) NewModuleInstance

func (*RootModule) NewModuleInstance(vu modules.VU) modules.Instance

Jump to

Keyboard shortcuts

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