internal

package
v0.0.0-...-3a7e411 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package internal provides the implementation support for heyyall

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IRequestor

type IRequestor interface {
	ProcessRqst(ep api.Endpoint, numRqsts int, rqstRate int)
	ResponseChan() chan Response
}

IRequestor declares the functionality needed to make requests to an endpoint

type OutputType

type OutputType int

OutputType specifies the output formate of the final report. There are 2 values, 'text' and 'json'. 'text' will present a human readable form. 'json' will present the JSON structures that capture the detailed run stats.

const (
	// Text specifies only high level report stats will be produced
	Text OutputType = iota
	// JSON indicates detailed reporting stats will be produced
	JSON
)

type Requestor

type Requestor struct {
	// Context is used to cancel the goroutine
	Ctx context.Context
	// ResponseC is used to send the results of a request to the response handler
	ResponseC chan Response
	// Client is the target of the test run
	Client http.Client
}

Requestor is the component that will schedule requests to endpoints. It expects to be run as a goroutine.

func (Requestor) ProcessRqst

func (r Requestor) ProcessRqst(ep api.Endpoint, numRqsts int, rqstRate int)

ProcessRqst runs the requests configured by 'ep' at the requested rate for either 'numRqsts' times or the configured run duration (set in Requestor.Ctx)

func (Requestor) ResponseChan

func (r Requestor) ResponseChan() chan Response

ResponseChan returns a chan Response

type Response

type Response struct {
	HTTPStatus           int
	Endpoint             api.Endpoint
	RequestDuration      time.Duration
	DNSLookupDuration    time.Duration
	TCPConnDuration      time.Duration
	RoundTripDuration    time.Duration
	TLSHandshakeDuration time.Duration
}

Response contains information describing the results of a request to a specific endpoint

type ResponseHandler

type ResponseHandler struct {
	OutputType OutputType
	ResponseC  chan Response
	ProgressC  chan interface{}
	DoneC      chan interface{}
	NumRqsts   int
	NormFactor int
	// contains filtered or unexported fields
}

ResponseHandler is responsible for accepting, summarizing, and reporting on the overall load test results.

func (*ResponseHandler) Start

func (rh *ResponseHandler) Start()

Start begins the process of accepting responses. It expects to be run as a goroutine.

type Scheduler

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

Scheduler determines which requests to make over the schedC channel based on each Endpoint's 'RqstPercent'

func NewScheduler

func NewScheduler(concurrency int, rate int, runDur time.Duration, numRqsts int,
	eps []api.Endpoint, rqstr IRequestor) (*Scheduler, error)

NewScheduler returns a valid Scheduler instance

func (Scheduler) Start

func (s Scheduler) Start() error

Start begins the scheduling process

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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