mock

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBenchmarkServer

func NewBenchmarkServer(ctx context.Context, wg *sync.WaitGroup, readyChan chan struct{}, errChan chan error)

NewBenchmarkServer will start a docker container with nginx

Types

type BenchmarkStats

type BenchmarkStats struct {
	RequestCount uint64
}

type LoaderHandler

type LoaderHandler struct {
	Stats               BenchmarkStats
	MixedFailedRequests int
	Args                []string
	// Only one body, loader can send only one Body in benchmark, might change later
	// If more than one body is in here, then we have an issue
	Body    [][]byte
	Headers map[string]*headerCount
	// contains filtered or unexported fields
}

func NewServer

func NewServer(mixedFailedRequests int) (*LoaderHandler, *httptest.Server)

func (*LoaderHandler) HandleAbortRequests

func (h *LoaderHandler) HandleAbortRequests(w http.ResponseWriter, r *http.Request)

func (*LoaderHandler) HandleArgsRequest

func (h *LoaderHandler) HandleArgsRequest(w http.ResponseWriter, r *http.Request)

Benchmark should contain only one request here, we want to check whether the args are set only

func (*LoaderHandler) HandleBodyRequests

func (h *LoaderHandler) HandleBodyRequests(w http.ResponseWriter, r *http.Request)

func (*LoaderHandler) HandleHeaderRequests

func (h *LoaderHandler) HandleHeaderRequests(w http.ResponseWriter, r *http.Request)

func (*LoaderHandler) HandleLongRequests

func (h *LoaderHandler) HandleLongRequests(w http.ResponseWriter, r *http.Request)

func (*LoaderHandler) HandleMixedRequests

func (h *LoaderHandler) HandleMixedRequests(w http.ResponseWriter, r *http.Request)

HandleMixedRequests first n requests will failed with 404

func (*LoaderHandler) HandleOKRequests

func (h *LoaderHandler) HandleOKRequests(w http.ResponseWriter, r *http.Request)

func (*LoaderHandler) ResetStats

func (h *LoaderHandler) ResetStats()

Jump to

Keyboard shortcuts

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