Documentation ¶
Index ¶
- type Tracer
- func (t *Tracer) ConnSetup() time.Duration
- func (t *Tracer) ContentTransfer() time.Duration
- func (t *Tracer) DNSLookup() time.Duration
- func (t *Tracer) Finish()
- func (t *Tracer) PreTransfer() time.Duration
- func (t *Tracer) ServerProcessing() time.Duration
- func (t *Tracer) String() string
- func (t *Tracer) TCPDialed() time.Duration
- func (t *Tracer) TimeToFirstByte() time.Duration
- func (t *Tracer) Total() time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer records timings for an http request
func AsTraceableReq ¶
AsTraceableReq wraps a given *http.Request with tracing timers and returns the wrapped request Use the returned Tracer value to query for various timing values that were recorded
func (*Tracer) ConnSetup ¶
ConnSetup returns time taken to fully create a connection that is ready to perform an http request
func (*Tracer) ContentTransfer ¶
ContentTransfer returns time taken from first byte till body is fully read
func (*Tracer) Finish ¶
func (t *Tracer) Finish()
Finish should be called as soon as a request body is read This method is important to calculate the total time taken
func (*Tracer) PreTransfer ¶
PreTransfer returns total time taken to setup everything before the server has a connection ready to go.
func (*Tracer) ServerProcessing ¶
ServerProcessing returns time taken by the server to receive the request and start replying (TimeToFirstByte since connection setup)
func (*Tracer) TimeToFirstByte ¶
TimeToFirstByte returns time since start till FirstResponse Byte