Documentation ¶
Index ¶
- Variables
- func AddRequestInterceptor(fn func(u *User, r *http.Request))
- func AddScenario(scenario *Scenario) error
- func CheckErrAndLogError(err error, s string)
- func CheckErrAndLogFatal(err error, s string)
- func CommandlineDefaults(users, RampUpSeconds, plateauSeconds, rampDownSeconds int, reportPath string)
- func DynamicJSON(jsonBytes []byte) interface{}
- func GenerateResultsReport(reportPath string) (unmetExpectation bool)
- func HeaderSize(headerMap map[string][]string) (headerSize int)
- func LogDateTime(b bool)
- func LogDebug(v ...interface{})
- func LogDebugf(format string, v ...interface{})
- func LogError(v ...interface{})
- func LogErrorf(format string, v ...interface{})
- func LogFatal(v ...interface{})
- func LogFatalf(format string, v ...interface{})
- func LogInfo(v ...interface{})
- func LogInfof(format string, v ...interface{})
- func LogSuccess(v ...interface{})
- func LogSuccessf(format string, v ...interface{})
- func LogWarning(v ...interface{})
- func LogWarningf(format string, v ...interface{})
- func PrintMissingSubcommandAndExit(validCommands ...*flag.FlagSet)
- func RandomDuration(min, max time.Duration) time.Duration
- func RandomElement(s []string) string
- func RandomNumber(min, max int) int
- func RandomUserAgent() string
- func Reset()
- func Run(outputFolder string, verboseLogs bool)
- func RunFromCommandlineArgs()
- func UnwrapDeepestError(currentErr error) string
- type AnalyzedResults
- type CommandlineArguments
- type CountExpectation
- type Counts
- type Environment
- type Expectation
- type HistogramBucket
- type LoadConfig
- type PercentageExpectation
- type PercentileExpectation
- type RandomInterval
- type RangeExpectation
- type Report
- type Request
- func (req *Request) SendWithTimeout(timeout time.Duration) *Response
- func (req *Request) SendWithoutTimeout() *Response
- func (req *Request) SetBody(body *io.Reader) *Request
- func (req *Request) SetCookie(key, value string) *Request
- func (req *Request) SetFormParam(key, value string) *Request
- func (req *Request) SetHeader(key, value string) *Request
- type Response
- func (response *Response) ArchiveStats() *Response
- func (response *Response) Assert(fn func(response *Response) (message string, ok bool)) *Response
- func (response *Response) AssertBodyContains(s string) *Response
- func (response *Response) AssertBodyMatches(re *regexp.Regexp) *Response
- func (response *Response) AssertBodySizeAtLeast(bytes int) *Response
- func (response *Response) AssertBodySizeAtMost(bytes int) *Response
- func (response *Response) AssertStatus(status string) *Response
- func (response *Response) AssertStatusCode(statusCode int) *Response
- func (response *Response) ConsideredUnsuccessful() bool
- func (response *Response) EvalExpressionOnJSON(expression string) interface{}
- func (response *Response) ExtractCaptureGroup(re *regexp.Regexp) string
- func (response *Response) ExtractSliceFromJSON(expression string) (result []string)
- func (response *Response) ExtractStringFromJSON(expression string) string
- func (response *Response) IsFailed() bool
- func (response *Response) MarkAsFailed(message string)
- func (response *Response) PrintStats(w io.Writer) *Response
- func (response *Response) TotalDuration() time.Duration
- type ResultHistogram
- type ResultPercentiles
- type ResultStats
- type RoundTripperWrapper
- type Scenario
- type Stats
- type StatusCodeExpectation
- type Step
- func (step *Step) ExpectErrorCountAtMost(count uint64) *Step
- func (step *Step) ExpectErrorPercentageAtMost(percentage float64) *Step
- func (step *Step) ExpectErrorTypeMatchesPercentageAtLeast(re *regexp.Regexp, percentage float64) *Step
- func (step *Step) ExpectErrorTypeMatchesPercentageAtMost(re *regexp.Regexp, percentage float64) *Step
- func (step *Step) ExpectFailureCountAtMost(count uint64) *Step
- func (step *Step) ExpectFailurePercentageAtMost(percentage float64) *Step
- func (step *Step) ExpectFailureTypeMatchesPercentageAtLeast(re *regexp.Regexp, percentage float64) *Step
- func (step *Step) ExpectFailureTypeMatchesPercentageAtMost(re *regexp.Regexp, percentage float64) *Step
- func (step *Step) ExpectStatusCodePercentageAtLeast(statusCode int, percentage float64) *Step
- func (step *Step) ExpectStatusCodePercentageAtMost(statusCode int, percentage float64) *Step
- func (step *Step) ExpectSuccessCountAtLeast(count uint64) *Step
- func (step *Step) ExpectSuccessPercentageAtLeast(percentage float64) *Step
- func (step *Step) ExpectTimeAfterRequestSentPercentileLimit(percentile float64, duration time.Duration) *Step
- func (step *Step) ExpectTimeToFirstBytePercentileLimit(percentile float64, duration time.Duration) *Step
- func (step *Step) ExpectTimeoutCountAtMost(count uint64) *Step
- func (step *Step) ExpectTimeoutPercentageAtMost(percentage float64) *Step
- func (step *Step) ExpectTimeoutTypeMatchesPercentageAtLeast(re *regexp.Regexp, percentage float64) *Step
- func (step *Step) ExpectTimeoutTypeMatchesPercentageAtMost(re *regexp.Regexp, percentage float64) *Step
- func (step *Step) ExpectTotalRequestBytesWithin(min, max uint64) *Step
- func (step *Step) ExpectTotalRequestResponseTimePercentileLimit(percentile float64, duration time.Duration) *Step
- func (step *Step) ExpectTotalResponseBytesWithin(min, max uint64) *Step
- func (step *Step) Request(method, url string) *Request
- func (step *Step) RequestRaw(targetURL string, buf *bufio.Reader) *Request
- func (step *Step) RequestRawFromFile(targetURL string, filename string) *Request
- type StepEntry
- type Timestamps
- type TypeMatchesThreshold
- type User
Constants ¶
This section is empty.
Variables ¶
var ( // exported AddUserLoopHeader bool AddScenarioStepHeader bool SkipCertificateValidation bool Proxy string UserAgent string )
var ( SubcommandReport *flag.FlagSet SubcommandRun *flag.FlagSet CommandlineArgs = &CommandlineArguments{} )
var UserAgents = []string{
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Safari/605.1.15",
"Mozilla/5.0 (Android; Linux armv7l; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 Fennec/10.0.1",
"Mozilla/5.0 (Android; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1",
"Mozilla/5.0 (WindowsCE 6.0; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
"Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0",
"Mozilla/5.0 (Windows NT 5.2; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1",
"Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2",
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/18.6.872.0 Safari/535.2 UNTRUSTED/1.0 3gpp-gba UNTRUSTED/1.0",
"Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120403211507 Firefox/12.0",
"Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.27 (KHTML, like Gecko) Chrome/12.0.712.0 Safari/534.27",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.24 Safari/535.1",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.36 Safari/535.7",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6",
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1",
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120427 Firefox/15.0a1",
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b4pre) Gecko/20100815 Minefield/4.0b4pre",
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0a2) Gecko/20110622 Firefox/6.0a2",
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1",
"Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3",
"Mozilla/5.0 (Windows; U; ; en-NZ) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.8.0",
"Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko Netscape/7.1 (ax)",
"Mozilla/5.0 (Windows; U; Windows CE 5.1; rv:1.8.1a3) Gecko/20060610 Minimo/0.016",
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10",
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.514.0 Safari/534.7",
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18",
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10",
"Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729; .NET4.0E)",
"Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9",
"Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.6 (Change: )",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.1 (KHTML, like Gecko) Maxthon/3.0.8.2 Safari/533.1",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.14 (KHTML, like Gecko) Chrome/9.0.601.0 Safari/534.14",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 GTB5",
"Mozilla/5.0 (Windows; U; Windows NT 6.0 x64; en-US; rv:1.9pre) Gecko/2008072421 Minefield/3.0.2pre",
"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.17) Gecko/20110123 (like Firefox/3.x) SeaMonkey/2.0.12",
"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5",
"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5",
"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.14 (KHTML, like Gecko) Chrome/10.0.601.0 Safari/534.14",
"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.20 (KHTML, like Gecko) Chrome/11.0.672.2 Safari/534.20",
"Mozilla/5.0 (Windows; U; Windows XP) Gecko MultiZilla/1.6.1.0a",
"Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2b) Gecko/20021001 Phoenix/0.2",
"Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20100101 Firefox/5.0",
"Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) QupZilla/1.2.0 Safari/534.34",
"Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/11.04 Chromium/14.0.825.0 Chrome/14.0.825.0 Safari/535.1",
"Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.2 (KHTML, like Gecko) Ubuntu/11.10 Chromium/15.0.874.120 Chrome/15.0.874.120 Safari/535.2",
"Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
"Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1",
"Mozilla/5.0 (X11; Linux i686; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1",
"Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0 ",
"Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
"Mozilla/5.0 (X11; Linux i686; rv:2.0b6pre) Gecko/20100907 Firefox/4.0b6pre",
"Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0",
"Mozilla/5.0 (X11; Linux i686; rv:6.0a2) Gecko/20110615 Firefox/6.0a2 Iceweasel/6.0a2",
"Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20100101 Firefox/6.0",
"Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Ubuntu/10.10 Chromium/12.0.703.0 Chrome/12.0.703.0 Safari/534.24",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.20 Safari/535.1",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5",
"Mozilla/5.0 (X11; Linux x86_64; en-US; rv:2.0b2pre) Gecko/20100712 Minefield/4.0b2pre",
"Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1",
"Mozilla/5.0 (X11; Linux x86_64; rv:11.0a2) Gecko/20111230 Firefox/11.0a2 Iceweasel/11.0a2",
"Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
"Mozilla/5.0 (X11; Linux x86_64; rv:2.2a1pre) Gecko/20100101 Firefox/4.2a1pre",
"Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0 Iceweasel/5.0",
"Mozilla/5.0 (X11; Linux x86_64; rv:7.0a1) Gecko/20110623 Firefox/7.0a1",
"Mozilla/5.0 (X11; U; FreeBSD amd64; en-us) AppleWebKit/531.2 (KHTML, like Gecko) Safari/531.2 Epiphany/2.30.0",
"Mozilla/5.0 (X11; U; FreeBSD i386; de-CH; rv:1.9.2.8) Gecko/20100729 Firefox/3.6.8",
"Mozilla/5.0 (X11; U; FreeBSD i386; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/4.0.207.0 Safari/532.0",
"Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040406 Galeon/1.3.15",
"Mozilla/5.0 (X11; U; FreeBSD; i386; en-US; rv:1.7) Gecko",
"Mozilla/5.0 (X11; U; FreeBSD x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16",
"Mozilla/5.0 (X11; U; Linux arm7tdmi; rv:1.8.1.11) Gecko/20071130 Minimo/0.025",
"Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1",
"Mozilla/5.0 (X11; U; Linux armv6l; rv 1.8.1.5pre) Gecko/20070619 Minimo/0.020",
"Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.10.1",
"Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.3) Gecko/20040924 Epiphany/1.4.4 (Ubuntu)",
"Mozilla/5.0 (X11; U; Linux i686; en-us) AppleWebKit/528.5 (KHTML, like Gecko, Safari/528.5 ) lt-GtkLauncher",
"Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.4 (KHTML, like Gecko) Chrome/4.0.237.0 Safari/532.4 Debian",
"Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.8 (KHTML, like Gecko) Chrome/4.0.277.0 Safari/532.8",
}
TODO add more user agent strings to choose from
Functions ¶
func AddRequestInterceptor ¶
func AddScenario ¶
func CheckErrAndLogError ¶
func CheckErrAndLogFatal ¶
func CommandlineDefaults ¶
func DynamicJSON ¶
func DynamicJSON(jsonBytes []byte) interface{}
func GenerateResultsReport ¶
GenerateResultsReport analyzes and prints the loadtest results. All index and step files below the given folder are analyzed. To merge multiple distributed collected results: place them as subfolders below the given folder.
func HeaderSize ¶
func LogDateTime ¶
func LogDateTime(b bool)
func LogSuccess ¶
func LogSuccess(v ...interface{})
func LogSuccessf ¶
func LogSuccessf(format string, v ...interface{})
func LogWarning ¶
func LogWarning(v ...interface{})
func LogWarningf ¶
func LogWarningf(format string, v ...interface{})
func RandomElement ¶
func RandomNumber ¶
func RandomUserAgent ¶
func RandomUserAgent() string
func RunFromCommandlineArgs ¶
func RunFromCommandlineArgs()
func UnwrapDeepestError ¶
Types ¶
type AnalyzedResults ¶
type AnalyzedResults struct { Stats ResultStats Percentiles ResultPercentiles Histogram ResultHistogram }
type CommandlineArguments ¶
type CountExpectation ¶
type Counts ¶
func (Counts) ErrorPercentage ¶
func (Counts) FailurePercentage ¶
func (Counts) SuccessPercentage ¶
func (Counts) TimeoutPercentage ¶
type Environment ¶
type Expectation ¶
type Expectation struct { SuccessPercentageAtLeast *PercentageExpectation FailurePercentageAtMost *PercentageExpectation ErrorPercentageAtMost *PercentageExpectation TimeoutPercentageAtMost *PercentageExpectation SuccessCountAtLeast *CountExpectation FailureCountAtMost *CountExpectation ErrorCountAtMost *CountExpectation TimeoutCountAtMost *CountExpectation TotalRequestResponseTimePercentileLimits []*PercentileExpectation TimeToFirstBytePercentileLimits []*PercentileExpectation TimeAfterRequestSentPercentileLimits []*PercentileExpectation TotalRequestBytesWithin *RangeExpectation TotalResponseBytesWithin *RangeExpectation StatusCodeThresholds []*StatusCodeExpectation FailureTypeMatchesThresholds []*TypeMatchesThreshold ErrorTypeMatchesThresholds []*TypeMatchesThreshold TimeoutTypeMatchesThresholds []*TypeMatchesThreshold }
type HistogramBucket ¶
type LoadConfig ¶
type LoadConfig struct { StartDelay RandomInterval LoopingUsers int LoopDelay RandomInterval RampUp, Plateau, RampDown time.Duration ClearCookieJarOnEveryLoop bool }
func DefaultLoadConfigFromArgs ¶
func DefaultLoadConfigFromArgs() LoadConfig
type PercentageExpectation ¶
type PercentileExpectation ¶
type RandomInterval ¶
func (RandomInterval) String ¶
func (ri RandomInterval) String() string
type RangeExpectation ¶
type Request ¶
type Request struct { Step *Step Method string URL string Disabled bool Raw bool User *User Headers map[string]string Cookies map[string]string FormParams map[string]string Timeout time.Duration Body *io.Reader Request *http.Request }
func (*Request) SendWithTimeout ¶
func (*Request) SendWithoutTimeout ¶
func (*Request) SetFormParam ¶
type Response ¶
type Response struct { Scenario string Step *Step RequestSize int ResponseSize int RequestURL string FinalURL string StatusCode int Status string Timestamps *Timestamps Timeout error Error error AssertionFailed string Body []byte // contains filtered or unexported fields }
func (*Response) ArchiveStats ¶
func (*Response) AssertBodyContains ¶
func (*Response) AssertBodyMatches ¶
func (*Response) AssertBodySizeAtLeast ¶
func (*Response) AssertBodySizeAtMost ¶
func (*Response) AssertStatus ¶
func (*Response) AssertStatusCode ¶
func (*Response) ConsideredUnsuccessful ¶
func (*Response) EvalExpressionOnJSON ¶
func (*Response) ExtractCaptureGroup ¶
func (*Response) ExtractSliceFromJSON ¶
func (*Response) ExtractStringFromJSON ¶
func (*Response) MarkAsFailed ¶
func (*Response) TotalDuration ¶
type ResultHistogram ¶
type ResultHistogram struct {
Buckets []HistogramBucket
}
type ResultPercentiles ¶
type ResultPercentiles struct {
P80p00, P90p00, P95p00, P99p00, P99p90, P99p99 float64 // all in nanoseconds
}
type ResultStats ¶
type ResultStats struct {
Minimum, Maximum, Mean, Median, StandardDeviation, FirstQuartile, ThirdQuartile, InterQuartileRange, Midhinge, Trimean float64 // all in nanoseconds
}
type RoundTripperWrapper ¶
type RoundTripperWrapper struct { //currentRequest *http.Request UserAgent string // contains filtered or unexported fields }
func NewRoundTripperWrapper ¶
func NewRoundTripperWrapper(skipCertificateValidationForInvalidTestCerts bool, proxy string) *RoundTripperWrapper
type Scenario ¶
type Scenario struct {
Title, Description string
Runner func(user *User)
LoadConfig LoadConfig
Ignored bool
ExecutionCount uint64
}
type Stats ¶
type Stats struct { Title string HasUnmetExpectation bool Counts Counts StatusCodes map[int]int FailureTypes, ErrorTypes, TimeoutTypes map[string]int RequestBytes, ResponseBytes uint64 TTFB, TARS, TRRT []float64 `json:"-"` // ignore in JSON as instead of raw-data we want the analyzed result data (AnalyzedResults) TimeToFirstByte, TimeAfterRequestSent, TotalRequestResponseTime AnalyzedResults Expectation Expectation }
type StatusCodeExpectation ¶
type Step ¶
type Step struct { Name string User *User Expectation *Expectation }
func (*Step) ExpectErrorCountAtMost ¶
ExpectErrorCountAtMost sets the maximum error count which is expected for this step.
When invoked multiple times, only the count when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectErrorPercentageAtMost ¶
ExpectErrorPercentageAtMost sets the maximum failure percentage level which is expected for this step. Values may range from 0.0 to 100.0 percent.
When invoked multiple times, only the percentage level when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectErrorTypeMatchesPercentageAtLeast ¶
func (step *Step) ExpectErrorTypeMatchesPercentageAtLeast(re *regexp.Regexp, percentage float64) *Step
ExpectErrorTypeMatchesPercentageAtLeast sets the expectation of the error type count (of the received error types) for the given step to be at least the given value.
When invoked multiple times, only the expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectErrorTypeMatchesPercentageAtMost ¶
func (step *Step) ExpectErrorTypeMatchesPercentageAtMost(re *regexp.Regexp, percentage float64) *Step
ExpectErrorTypeMatchesPercentageAtMost sets the expectation of the error type count (of the received error types) for the given step to be at most the given value.
When invoked multiple times, only the expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectFailureCountAtMost ¶
ExpectFailureCountAtMost sets the maximum failure count which is expected for this step.
When invoked multiple times, only the count when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectFailurePercentageAtMost ¶
ExpectFailurePercentageAtMost sets the maximum failure percentage level which is expected for this step. Values may range from 0.0 to 100.0 percent.
When invoked multiple times, only the percentage level when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectFailureTypeMatchesPercentageAtLeast ¶
func (step *Step) ExpectFailureTypeMatchesPercentageAtLeast(re *regexp.Regexp, percentage float64) *Step
ExpectFailureTypeMatchesPercentageAtLeast sets the expectation of the failure type count (of the received failure types) for the given step to be at least the given value.
When invoked multiple times, only the expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectFailureTypeMatchesPercentageAtMost ¶
func (step *Step) ExpectFailureTypeMatchesPercentageAtMost(re *regexp.Regexp, percentage float64) *Step
ExpectFailureTypeMatchesPercentageAtMost sets the expectation of the failure type count (of the received failure types) for the given step to be at most the given value.
When invoked multiple times, only the expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectStatusCodePercentageAtLeast ¶
ExpectStatusCodePercentageAtLeast sets the expectation of the status code count (of the received status codes) for the given step to be at least the given value.
When invoked multiple times, only the expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectStatusCodePercentageAtMost ¶
ExpectStatusCodePercentageAtMost sets the expectation of the status code count (of the received status codes) for the given step to be at most the given value.
When invoked multiple times, only the expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectSuccessCountAtLeast ¶
ExpectSuccessCountAtLeast sets the minimum success count which is expected for this step.
When invoked multiple times, only the count when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectSuccessPercentageAtLeast ¶
ExpectSuccessPercentageAtLeast sets the minimum success percentage level which is expected for this step. Values may range from 0.0 to 100.0 percent.
When invoked multiple times, only the percentage level when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectTimeAfterRequestSentPercentileLimit ¶
func (step *Step) ExpectTimeAfterRequestSentPercentileLimit(percentile float64, duration time.Duration) *Step
ExpectTimeAfterRequestSentPercentileLimit sets the expectation of the duration for the given percentile is within the given maximum duration. Percent values may range from 0.0 to 100.0 percent.
When invoked multiple times, only the percentile expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectTimeToFirstBytePercentileLimit ¶
func (step *Step) ExpectTimeToFirstBytePercentileLimit(percentile float64, duration time.Duration) *Step
ExpectTimeToFirstBytePercentileLimit sets the expectation of the duration for the given percentile is within the given maximum duration. Percent values may range from 0.0 to 100.0 percent.
When invoked multiple times, only the percentile expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectTimeoutCountAtMost ¶
ExpectTimeoutCountAtMost sets the maximum timeout count which is expected for this step.
When invoked multiple times, only the count when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectTimeoutPercentageAtMost ¶
ExpectTimeoutPercentageAtMost sets the maximum failure percentage level which is expected for this step. Values may range from 0.0 to 100.0 percent.
When invoked multiple times, only the percentage level when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectTimeoutTypeMatchesPercentageAtLeast ¶
func (step *Step) ExpectTimeoutTypeMatchesPercentageAtLeast(re *regexp.Regexp, percentage float64) *Step
ExpectTimeoutTypeMatchesPercentageAtLeast sets the expectation of the timeout type count (of the received timeout types) for the given step to be at least the given value.
When invoked multiple times, only the expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectTimeoutTypeMatchesPercentageAtMost ¶
func (step *Step) ExpectTimeoutTypeMatchesPercentageAtMost(re *regexp.Regexp, percentage float64) *Step
ExpectTimeoutTypeMatchesPercentageAtMost sets the expectation of the timeout type count (of the received timeout types) for the given step to be at most the given value.
When invoked multiple times, only the expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectTotalRequestBytesWithin ¶
ExpectTotalRequestBytesWithin sets the expectation of the total request byte count for the given step.
When invoked multiple times, only the expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectTotalRequestResponseTimePercentileLimit ¶
func (step *Step) ExpectTotalRequestResponseTimePercentileLimit(percentile float64, duration time.Duration) *Step
ExpectTotalRequestResponseTimePercentileLimit sets the expectation of the duration for the given percentile is within the given maximum duration. Percent values may range from 0.0 to 100.0 percent.
When invoked multiple times, only the percentile expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) ExpectTotalResponseBytesWithin ¶
ExpectTotalResponseBytesWithin sets the expectation of the total request byte count for the given step.
When invoked multiple times, only the expectation value when archiving the step's stats for the first time is used (i.e. subsequent invocations post-archive are silently ignored).
func (*Step) RequestRaw ¶
NOTE: You (caller) need to set Content-Length explicitly in raw request input correctly AND don't set Accept-Encoding header, so that it will automatically added by transport and then automatically decompressed: see https://stackoverflow.com/questions/13130341/reading-gzipped-http-response-in-go
type Timestamps ¶
type Timestamps struct { Start time.Time WroteRequest time.Time GotFirstResponseByte time.Time Done time.Time }
func (*Timestamps) TimeToFirstByte ¶
func (stats *Timestamps) TimeToFirstByte(afterRequestSent bool) (d time.Duration, completed bool)
func (*Timestamps) TotalDuration ¶
func (stats *Timestamps) TotalDuration() (d time.Duration, completed bool)