request

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClients

func NewClients(kubeCfgPath string, num int, userAgent string, qps int) ([]rest.Interface, error)

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? 3. Support Protobuf as accepted content

func Schedule

func Schedule(ctx context.Context, spec *types.LoadProfileSpec, restCli []rest.Interface) (*types.ResponseStats, error)

Schedule files requests to apiserver based on LoadProfileSpec.

Types

type RESTRequestBuilder

type RESTRequestBuilder interface {
	Build(cli rest.Interface) (method string, _ *rest.Request)
}

RESTRequestBuilder is used to build rest.Request.

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

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.

Jump to

Keyboard shortcuts

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