results

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 12, 2014 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Index, Code   int
	Took          float64
	Error         error
	TotalLength   int64
	ContentLength int64
	HeaderLength  int64
}

Result is the performance test result transporter.

type Results

type Results struct {
	Requested  int
	Replies    int
	TotalTime  float64
	ConnPerSec float64

	Took     []float64
	TookMin  float64
	TookMed  float64
	TookAvg  float64
	TookMax  float64
	Took85th float64
	Took90th float64
	Took95th float64
	Took99th float64

	Code    []int
	Code1xx int
	Code2xx int
	Code3xx int
	Code4xx int
	Code5xx int

	Errors            []error
	ErrorsTotal       int
	ErrorsConnTimeout int
	ErrorsConnRefused int
	ErrorsConnReset   int
	ErrorsFdUnavail   int
	ErrorsAddrUnavail int
	ErrorsOther       int

	ContentLength int64
	HeaderLength  int64
	TotalLength   int64
}

Results is a container for the performance test results.

Example
// This should typically not be created manaully, but rather by
// Connector{}.New( ... )

r := Results{
	Took: make([]float64, 10),
	Code: make([]int, 10),
}

t := Result{
	Index: 0,
	Took:  300.0,
	Code:  200,
}

r.Add(t)

// If running this manually, as opposed to via (*Connector{}).Run()
// you must finalize to create max, min, avg, etc.
r.Finalize()

fmt.Printf("Took: %f\n", r.Took[0])
fmt.Printf("Code: %d\n", r.Code[0])
fmt.Printf("Max:  %f\n", r.TookMax)
Output:

Took: 300.000000
Code: 200
Max:  300.000000

func (*Results) Add

func (res *Results) Add(result Result)

Add adds Result data to Results.

func (*Results) CalculatePct

func (res *Results) CalculatePct(pct int) float64

CalculatePct calculates percentiles from existing Took values.

func (*Results) Finalize

func (res *Results) Finalize()

Finalize finalizes results, generating min, max, avg med and percentiles.

Jump to

Keyboard shortcuts

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