http

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResultTmpl = `` /* 1397-byte string literal not displayed */

)

Functions

This section is empty.

Types

type ElapsedInfo

type ElapsedInfo struct {
	Max float64 `json:"max,omitempty"`
	Min float64 `json:"min,omitempty"`
	Avg float64 `json:"avg,omitempty"`
}

type HttpBuilder

type HttpBuilder struct {
	HttpReq    *http.Request
	HttpClient *http.Client
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder() *HttpBuilder

func (*HttpBuilder) CreateTask

func (builder *HttpBuilder) CreateTask(ConfigArgs *config.ProtoConfigArgs) (string, error)

func (*HttpBuilder) Done

func (builder *HttpBuilder) Done(total time.Duration) (interface{}, error)

func (*HttpBuilder) Init

func (builder *HttpBuilder) Init(ctx context.Context, taskReq *pb.TaskRequest) error

func (*HttpBuilder) Merge

func (builder *HttpBuilder) Merge(messages []string) (interface{}, error)

func (*HttpBuilder) PostRequest

func (builder *HttpBuilder) PostRequest(result interface{}) error

func (*HttpBuilder) PreRequest

func (builder *HttpBuilder) PreRequest(taskReq *pb.TaskRequest) (interface{}, interface{})

func (*HttpBuilder) Request

func (builder *HttpBuilder) Request(ctx context.Context, obj interface{}, taskReq *pb.TaskRequest) interface{}

func (*HttpBuilder) Split

func (builder *HttpBuilder) Split(request *pb.ExecuteTaskRequest, count int) []*pb.ExecuteTaskRequest

type HttpStats

type HttpStats struct {
	TotalRequests int64 `json:"totalRequests,omitempty"`
	// Total time for running
	Duration       float64 `json:"duration,omitempty"`
	FastestReqTime float64 `json:"fastestReqTime,omitempty"`
	SlowestReqTime float64 `json:"slowestReqTime,omitempty"`
	AvgReqTime     float64 `json:"avgReqTime,omitempty"`
	// Average response size per request
	AvgSize int64 `json:"avgSize,omitempty"`
	// The sum of all response sizes
	TotalSize int64 `json:"totalSize,omitempty"`
	// Requests per second
	Rps           float64     `json:"rps,omitempty"`
	Dns           ElapsedInfo `json:"dns,omitempty"`
	Delay         ElapsedInfo `json:"delay,omitempty"`
	Resp          ElapsedInfo `json:"resp,omitempty"`
	Conn          ElapsedInfo `json:"conn,omitempty"`
	Req           ElapsedInfo `json:"req,omitempty"`
	StatusCodes   map[uint32]uint32
	ErrMap        map[string]uint32
	ConnDuration  float64 `json:"connDuration,omitempty"`
	DnsDuration   float64 `json:"dnsDuration,omitempty"`
	ReqDuration   float64 `json:"reqDuration,omitempty"`
	RespDuration  float64 `json:"respDuration,omitempty"`
	DelayDuration float64 `json:"delayDuration,omitempty"`
	// Total number of requests
	Requests            int64                 `json:"requests,omitempty"`
	TotalDuration       float64               `json:"totalDuration,omitempty"`
	LatencyDistribution []LatencyDistribution `json:latencyDistribution,omitempty`
	// time spent per request
	Lats []float64 `json:"latencies,omitempty"`
}

type LatencyDistribution

type LatencyDistribution struct {
	Percentage uint32
	Latency    float64
}

Jump to

Keyboard shortcuts

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