http

package
v0.0.0-...-8fb13b5 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const RequestDurationMetricName = "request_duration_s"

RequestDurationMetricName is the name of the http request duration metric.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointTransformer

type EndpointTransformer interface {
	Transform(*url.URL) string
}

EndpointTransformer is the interface for a transformer that can be configured for modifying the endpoint label on the request duration metric.

type TimedRoundTripper

type TimedRoundTripper struct {
	http.RoundTripper
	// contains filtered or unexported fields
}

TimedRoundTripper is an `http.RoundTripper` that captures request timing.

func NewTimedRoundTripper

func NewTimedRoundTripper(rt http.RoundTripper, endpointTransformer EndpointTransformer) *TimedRoundTripper

NewTimedRoundTripper constructs a new TimedRoundTripper with configurable EndpointTransformer.

func (*TimedRoundTripper) Register

func (rt *TimedRoundTripper) Register(registry *e2e.Registry) error

Register is used to register the TimedRoundTripper's request duration metric with a registry.

func (*TimedRoundTripper) RoundTrip

func (rt *TimedRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip measures the request duration of the http request.

Jump to

Keyboard shortcuts

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