nethttp

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 19 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
	HTTP2       bool
	HTTP3       bool
}

Flags control HTTP load setup.

type JobProducer

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

JobProducer sends HTTP requests.

func NewJobProducer

func NewJobProducer(f Flags, lf loadgen.Flags) (*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