Documentation ¶
Index ¶
- func AllocateJobs(noOfJobs int, noOfWarmupJobs int, testDuration time.Duration, ...) error
- func BuildBuckets(distribution []float32) ([]float32, error)
- func ConfigureLog(logLevel string)
- func ConsumeResults(results chan Result, done chan bool, report *Report)
- func GenerateRandomValue(min, max int) int
- func NewTrace(traceableTransport TraceableTransport) *httptrace.ClientTrace
- func Run(config Configuration, reportType, reportFilePath string)
- func SelectBucket(buckets []float32) int
- func SelectBucketContaining(value int, buckets []float32) int
- type Certificates
- type Configuration
- type ItemProvider
- type Job
- type Parameters
- type RampUp
- type RandomNumberProvider
- type Report
- type Result
- type Scenario
- type ScenarioResult
- type Trace
- type TraceableTransport
- func (t *TraceableTransport) ConnectDone(network, addr string, err error)
- func (t *TraceableTransport) ConnectStart(network, addr string)
- func (t *TraceableTransport) DNSDone(info httptrace.DNSDoneInfo)
- func (t *TraceableTransport) DNSStart(info httptrace.DNSStartInfo)
- func (t *TraceableTransport) GetConn(hostPort string)
- func (t *TraceableTransport) Got100Continue()
- func (t *TraceableTransport) Got1xxResponse(code int, header textproto.MIMEHeader) error
- func (t *TraceableTransport) GotConn(info httptrace.GotConnInfo)
- func (t *TraceableTransport) GotFirstResponseByte()
- func (t *TraceableTransport) PutIdleConn(err error)
- func (t *TraceableTransport) RoundTrip(req *http.Request) (*http.Response, error)
- func (t *TraceableTransport) TLSHandshakeDone(state tls.ConnectionState, err error)
- func (t *TraceableTransport) TLSHandshakeStart()
- func (t *TraceableTransport) Wait100Continue()
- func (t *TraceableTransport) WroteRequest(info httptrace.WroteRequestInfo)
- type ValueProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllocateJobs ¶
func AllocateJobs(noOfJobs int, noOfWarmupJobs int, testDuration time.Duration, warmupDuration time.Duration, maxSpeedPerSecond int, scenarios []Scenario, jobs chan Job) error
AllocateJobs creates jobs and adds them to the jobs queue It receives noOfJobs and testDurationMs, if the second is grated than 0 it takes precedences and keeps pushing jobs during the defined period. If not the specified value of jobs will be created
func BuildBuckets ¶
Provided a slice containing values between 0.0:1.0 it generates buckets containing values between 0:100
func ConfigureLog ¶
func ConfigureLog(logLevel string)
func ConsumeResults ¶
func GenerateRandomValue ¶
func NewTrace ¶
func NewTrace(traceableTransport TraceableTransport) *httptrace.ClientTrace
func Run ¶
func Run(config Configuration, reportType, reportFilePath string)
func SelectBucket ¶
It generates a value between 0:100 and it looks for the bucket containing the value generated It returns the idx representing a bucket in of the bucket containing the value, -1 if the value was not found
func SelectBucketContaining ¶
It looks for the bucket containing the value sent as parameter It returns the idx of the bucket containing the value, -1 if the value was not found
Types ¶
type Certificates ¶
type Configuration ¶
type Configuration struct { Name string Parameters Parameters Certificates Certificates Scenarios []Scenario }
type ItemProvider ¶
type ItemProvider struct {
// contains filtered or unexported fields
}
func NewItemProvider ¶
func NewItemProvider(items []string) *ItemProvider
func (*ItemProvider) Provide ¶
func (p *ItemProvider) Provide() string
type Job ¶
type Job struct { Id int Name string ScenarioId int Method string Url string ReqBody io.Reader Headers map[string]string Timeout time.Duration AllowConnectionReuse bool IsWarmup bool SuccessValidator func(status int) bool }
TODO this probably needs a new name
func (*Job) ValidateSuccess ¶
type Parameters ¶
type RandomNumberProvider ¶
func NewRandomNumberProvider ¶
func NewRandomNumberProvider(min, max int) (*RandomNumberProvider, error)
func (*RandomNumberProvider) Provide ¶
func (p *RandomNumberProvider) Provide() string
type Report ¶
type Report struct { OverallResult ScenarioResult ScenarioResults map[int]*ScenarioResult }
type Result ¶
type ScenarioResult ¶
type ScenarioResult struct { Name string RequestCount int64 FailCount int64 SuccessCount int64 TimeoutCount int64 DefinedTimeout time.Duration Td tdigest.TDigest DurationRequestSum time.Duration }
func (*ScenarioResult) FailRate ¶
func (sr *ScenarioResult) FailRate() float32
func (*ScenarioResult) SuccessRate ¶
func (sr *ScenarioResult) SuccessRate() float32
func (*ScenarioResult) TimoutRate ¶
func (sr *ScenarioResult) TimoutRate() float32
type Trace ¶
type Trace struct { GotConnTime time.Time GetConnTime time.Time DNSStartTime time.Time DNSDoneTime time.Time ConnectStartTime time.Time ConnectDoneTime time.Time TLSHandshakeStartTime time.Time TLSHandshakeDoneTime time.Time PutIdleConnTime time.Time WroteRequestTime time.Time GotFirstResponseByteTime time.Time Got100ContinueTime time.Time Got1xxResponseTime time.Time Wait100ContinueTime time.Time }
type TraceableTransport ¶
TraceableTransport is an http.RoundTripper that keeps track of the in-flight request and implements hooks to report HTTP tracing events.
func (*TraceableTransport) ConnectDone ¶
func (t *TraceableTransport) ConnectDone(network, addr string, err error)
func (*TraceableTransport) ConnectStart ¶
func (t *TraceableTransport) ConnectStart(network, addr string)
func (*TraceableTransport) DNSDone ¶
func (t *TraceableTransport) DNSDone(info httptrace.DNSDoneInfo)
func (*TraceableTransport) DNSStart ¶
func (t *TraceableTransport) DNSStart(info httptrace.DNSStartInfo)
func (*TraceableTransport) GetConn ¶
func (t *TraceableTransport) GetConn(hostPort string)
func (*TraceableTransport) Got100Continue ¶
func (t *TraceableTransport) Got100Continue()
func (*TraceableTransport) Got1xxResponse ¶
func (t *TraceableTransport) Got1xxResponse(code int, header textproto.MIMEHeader) error
func (*TraceableTransport) GotConn ¶
func (t *TraceableTransport) GotConn(info httptrace.GotConnInfo)
func (*TraceableTransport) GotFirstResponseByte ¶
func (t *TraceableTransport) GotFirstResponseByte()
func (*TraceableTransport) PutIdleConn ¶
func (t *TraceableTransport) PutIdleConn(err error)
func (*TraceableTransport) TLSHandshakeDone ¶
func (t *TraceableTransport) TLSHandshakeDone(state tls.ConnectionState, err error)
func (*TraceableTransport) TLSHandshakeStart ¶
func (t *TraceableTransport) TLSHandshakeStart()
func (*TraceableTransport) Wait100Continue ¶
func (t *TraceableTransport) Wait100Continue()
func (*TraceableTransport) WroteRequest ¶
func (t *TraceableTransport) WroteRequest(info httptrace.WroteRequestInfo)
type ValueProvider ¶
type ValueProvider interface {
Provide() string
}