engine

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2019 License: Apache-2.0 Imports: 13 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpBench

func HttpBench(sc *SyncConfig, reqDelay time.Duration, newReq func(uniqueId string) (*http.Request, error))

Types

type SyncConcurrent

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

func NewSyncConcurrent

func NewSyncConcurrent() *SyncConcurrent

func (*SyncConcurrent) MaxConcurrent

func (syncC *SyncConcurrent) MaxConcurrent() uint64

func (*SyncConcurrent) NewSyncConfig

func (syncC *SyncConcurrent) NewSyncConfig(hook syncedtrace.TraceHookType, concurrencyLimit uint64, duration time.Duration, waitReq bool, result chan *TraceResult) *SyncConfig

func (*SyncConcurrent) ReqCounter

func (syncC *SyncConcurrent) ReqCounter() uint64

func (*SyncConcurrent) WaitAll

func (syncC *SyncConcurrent) WaitAll()

type SyncConfig

type SyncConfig struct {
	Concurrency *concurrency.Manager
	// contains filtered or unexported fields
}

func NewSyncConfig

func NewSyncConfig(hook syncedtrace.TraceHookType, concurrencyLimit uint64, duration time.Duration, waitReq bool, result chan *TraceResult) *SyncConfig

concurrencyLimit == 0 for unlimited concurrency Duration == 0 for one time loop

func (*SyncConfig) Duration

func (sc *SyncConfig) Duration() <-chan time.Time

func (*SyncConfig) IsDurationSet

func (sc *SyncConfig) IsDurationSet() bool

func (*SyncConfig) MaxReqReached

func (sc *SyncConfig) MaxReqReached() bool

func (*SyncConfig) ReqCounter

func (sc *SyncConfig) ReqCounter() uint64

func (*SyncConfig) SetReqDelay

func (sc *SyncConfig) SetReqDelay(reqDelay time.Duration)

func (*SyncConfig) SetSyncedConcurrent

func (sc *SyncConfig) SetSyncedConcurrent(syncedCount uint64)

func (*SyncConfig) WaitAll

func (sc *SyncConfig) WaitAll()

func (*SyncConfig) WaitReqDelay

func (sc *SyncConfig) WaitReqDelay()

type TraceResult

type TraceResult struct {
	*syncedtrace.Trace `json:"trace_hooks" yaml:"trace_hooks"`
	Summary            *TraceSummary     `json:"trace_summary" yaml:"trace_summary"`
	Response           *http.Response    `json:"-" yaml:"-"`
	Body               string            `json:"response_body,string" yaml:"response_body,flow"`
	Err                *TraceResultError `json:"error" yaml:"error"`
}

func NewTraceResult

func NewTraceResult(traceHooks *syncedtrace.Trace, resp *http.Response) *TraceResult

func (*TraceResult) ReadBody

func (tr *TraceResult) ReadBody()

func (*TraceResult) TraceSummary

func (tr *TraceResult) TraceSummary()

type TraceResultError

type TraceResultError struct {
	Message string
}

func NewTraceResultError

func NewTraceResultError(err error) *TraceResultError

func (*TraceResultError) Error

func (traceResultError *TraceResultError) Error() string

type TraceSummary

type TraceSummary struct {
	Dns          time.Duration
	TcpHandshake time.Duration
	TlsHandshake time.Duration
	GotConn      time.Duration
	WroteRequest time.Duration
	FirstByte    time.Duration
	ReadingBody  time.Duration
}

Jump to

Keyboard shortcuts

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