Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClients ¶
NewClients creates N rest.Interface.
FIXME(weifu):
1. Is it possible to build one http2 client with multiple connections? 2. How to monitor HTTP2 GOAWAY frame?
Types ¶
type BaseRequester ¶ added in v0.3.0
type BaseRequester struct {
// contains filtered or unexported fields
}
func (*BaseRequester) Method ¶ added in v0.3.0
func (reqr *BaseRequester) Method() string
func (*BaseRequester) Timeout ¶ added in v0.3.0
func (reqr *BaseRequester) Timeout(timeout time.Duration)
func (*BaseRequester) URL ¶ added in v0.3.0
func (reqr *BaseRequester) URL() *url.URL
type ClientCfgOpt ¶ added in v0.0.2
type ClientCfgOpt func(*clientCfg)
ClientCfgOpt is used to update default client setting.
func WithClientContentTypeOpt ¶ added in v0.0.2
func WithClientContentTypeOpt(ct types.ContentType) ClientCfgOpt
WithClientContentTypeOpt updates content type of response.
func WithClientDisableHTTP2Opt ¶ added in v0.0.2
func WithClientDisableHTTP2Opt(b bool) ClientCfgOpt
WithClientDisableHTTP2Opt disables HTTP2 protocol.
func WithClientQPSOpt ¶ added in v0.0.2
func WithClientQPSOpt(qps float64) ClientCfgOpt
WithClientQPSOpt updates QPS value.
func WithClientUserAgentOpt ¶ added in v0.0.2
func WithClientUserAgentOpt(ua string) ClientCfgOpt
WithClientUserAgentOpt updates user agent.
type DiscardRequester ¶ added in v0.3.0
type DiscardRequester struct {
BaseRequester
}
type RESTRequestBuilder ¶
RESTRequestBuilder is used to build rest.Request.
type Result ¶ added in v0.0.2
type Result struct { types.ResponseStats // Duration means the time of benchmark. Duration time.Duration // Total means the total number of requests. Total int }
Result contains responseStats vlaues from Gather() and adds Duration and Total values separately
type WatchListRequester ¶ added in v0.3.0
type WatchListRequester struct {
BaseRequester
}
type WeightedRandomRequests ¶
type WeightedRandomRequests struct {
// contains filtered or unexported fields
}
WeightedRandomRequests is used to generate requests based on LoadProfileSpec.
func NewWeightedRandomRequests ¶
func NewWeightedRandomRequests(spec *types.LoadProfileSpec) (*WeightedRandomRequests, error)
NewWeightedRandomRequests creates new instance of WeightedRandomRequests.
func (*WeightedRandomRequests) Chan ¶
func (r *WeightedRandomRequests) Chan() chan RESTRequestBuilder
Chan returns channel to get random request.
func (*WeightedRandomRequests) Run ¶
func (r *WeightedRandomRequests) Run(ctx context.Context, total int)
Run starts to random pick request.
func (*WeightedRandomRequests) Stop ¶
func (r *WeightedRandomRequests) Stop()
Stop stops request generator.