Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClient = http.DefaultClient
DefaultClient is the default HTTP client
Functions ¶
This section is empty.
Types ¶
type DefaultTracer ¶
type DefaultTracer struct {
// contains filtered or unexported fields
}
DefaultTracer stores http request timings
func (*DefaultTracer) Done ¶ added in v0.1.6
func (t *DefaultTracer) Done()
func (*DefaultTracer) Timings ¶
func (t *DefaultTracer) Timings() Timings
Timings computes and returns the timings for a request
func (*DefaultTracer) Tracer ¶
func (t *DefaultTracer) Tracer() *httptrace.ClientTrace
Tracer returns a new httptrace.ClientTrace
type TimedClient ¶
type TimedClient struct {
// contains filtered or unexported fields
}
TimedClient adds http request timings as part of the http response
func NewTimedClient ¶
func NewTimedClient(client *http.Client) *TimedClient
NewTimedClient creates a default timed client
type Timings ¶
type Timings struct { DNSLookup, TCPConnection, TLSHandshake, ServerProcessing, ContentTransfer time.Duration }
Timings holds the timings data for a http request
type Tracer ¶
type Tracer interface { Tracer() *httptrace.ClientTrace Timings() Timings // Done needs to be called when the request is finished. // Without calling done the ContentTransfer in the Timings will be invalid. Done() }
Tracer is the interface for a tracer
Click to show internal directories.
Click to hide internal directories.