sampler

package
v0.0.0-...-b9af62b Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonURL

type JsonURL struct {
	*url.URL
}

The JsonURL type allows us to parse the URL from a JSON document at load time, instead of when it's used (which could be multiple times)

func NewJsonURL

func NewJsonURL(str string) (u *JsonURL, err error)

func (*JsonURL) UnmarshalJSON

func (self *JsonURL) UnmarshalJSON(data []byte) (err error)

type Sample

type Sample struct {
	StatusCode      int
	TimeStart       time.Time
	TimeToResolveIP time.Time
	TimeToConnect   time.Time
	TimeToFirstByte time.Time
	TimeEnd         time.Time
	ResponseHeaders http.Header
	LocalAddr       net.IP
	RemoteAddr      net.IP
}

func Ping

func Ping(target Target, timeout int) (sample Sample, err error)

Ping measures a given URL and returns a Sample

type StatusCodeError

type StatusCodeError struct {
	StatusCode int
}

StatusCodeError is an error representing an HTTP Status code of 400 or greater.

func (StatusCodeError) Error

func (e StatusCodeError) Error() string

type Target

type Target struct {
	URL      JsonURL
	Name     string
	Interval int
	// metadata
	Tags               []string
	Attributes         map[string]string
	Hash               string
	RequestHeaders     map[string]string
	InsecureSkipVerify bool
}

func (*Target) SetHash

func (t *Target) SetHash()

Jump to

Keyboard shortcuts

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