Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Concurrency is the number of concurrent requests to send.
// Default: 1
Concurrency int
// RPS is the requests to send per second.
// Default: 0 (no rate limiting)
RPS int
// Send processes requests.
// Default: Uses [Send].
Send SendFunc
}
Options defines the options for sending requests. Uses default options for unset options.
type Result ¶
type Result struct {
Status int // Status is the HTTP status code
Bytes int64 // Bytes is the number of bytes transferred
Duration time.Duration // Duration is the time to complete a request
Error error // Error received after sending a request
}
Result is performance metrics of a single http.Request.
type SendFunc ¶
SendFunc is a type of function that sends an http.Request and returns a Result.
type Summary ¶
type Summary struct {
Started time.Time // Started is the time when requests began
Requests int // Requests is the total number of requests made
Errors int // Errors is the total number of failed requests
Bytes int64 // Bytes is the total number of bytes transferred
RPS float64 // RPS is the number of requests sent per second
Duration time.Duration // Duration is the total time taken by requests
Fastest time.Duration // Fastest is the fastest request duration
Slowest time.Duration // Slowest is the slowest request duration
Success float64 // Success is the ratio of successful requests
}
Summary is the summary of Result values.
Click to show internal directories.
Click to hide internal directories.