Documentation ¶
Overview ¶
Package request provides types and functions to describe executed requests and their attributes
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FinishedRequest ¶
type FinishedRequest struct { // The URL this request was executed for URL string // Any error received during the request Error error // The HTTP status code of the request StatusCode int // The start time Started time.Time // The time the request has finished Finished time.Time // The content length ContentLength int64 // HTTP response headers received Header Header // Stats whether this request reused an established TCP connection via HTTP keep alive or created a fresh one Reused bool // Timing details for this request TimingDetails TimingDetails }
FinishedRequest represents a single sample of an HTTP(S) request. It includes status and timing information
func ExecuteGet ¶
ExecuteGet executes a HTTP(S) GET Request for the given URL and returns the result as a Request
func (*FinishedRequest) ContentType ¶
func (r *FinishedRequest) ContentType() string
ContentType is a convenience method that returns the content type header value
func (*FinishedRequest) IsError ¶
func (r *FinishedRequest) IsError() bool
IsError returns whether this sample was successful or not
func (*FinishedRequest) TotalTime ¶
func (r *FinishedRequest) TotalTime() time.Duration
TotalTime returns the total time needed to execute the request
type Header ¶
Header contains the HTTP response headers for a request Header names are canonicalized, i.e. "Content-Length"
type TimingDetails ¶
type TimingDetails struct { // The total time needed to execute the request TotalTime time.Duration // The time needed to resolve the host name via DNS DNSTime time.Duration // The time needed to establish a TCP connection TCPConnectTime time.Duration // The time needed to perform the TLS handshake TLSTime time.Duration // The time needed to write the request SendRequestTime time.Duration // The time waited for the first response byte TimeToFirstByte time.Duration // The time needed to transfer all content ContentTransferTime time.Duration }
Click to show internal directories.
Click to hide internal directories.