nethttp

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 20 Imported by: 1

Documentation

Overview

Package nethttp implements HTTP load producer with net/http.

Index

Constants

View Source
const HTTP3Available = true

HTTP3Available guards HTTP3 library.

View Source
const SampleSize = 1000

SampleSize is maximum number of bytes to sample from response.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flags

type Flags struct {
	HeaderMap          map[string]string
	URL                string
	Body               string
	Method             string
	NoKeepalive        bool
	Compressed         bool
	Fast               bool
	IgnoreResponseBody bool
	HTTP2              bool
	HTTP3              bool
}

Flags control HTTP load setup.

type JobProducer

type JobProducer struct {
	PrepareRequest      func(i int, req *http.Request) error
	PrepareRoundTripper func(tr http.RoundTripper) http.RoundTripper
	// contains filtered or unexported fields
}

JobProducer sends HTTP requests.

func NewJobProducer

func NewJobProducer(f Flags, lf loadgen.Flags, options ...func(lf *loadgen.Flags, f *Flags, j loadgen.JobProducer)) (*JobProducer, error)

NewJobProducer creates HTTP load generator.

func (*JobProducer) Job

func (j *JobProducer) Job(i int) (time.Duration, error)

Job runs single item of load.

func (*JobProducer) RequestCounts

func (j *JobProducer) RequestCounts() map[string]int

RequestCounts returns distribution by status code.

func (*JobProducer) String added in v0.3.0

func (j *JobProducer) String() string

String prints results.

Jump to

Keyboard shortcuts

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