pinger

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2016 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoParallelPings

func DoParallelPings(config config.Config, queue chan<- *RequestInfo)

DoParallelPings calls ping on the given URIs and pushes the result in the given queue

Types

type RequestInfo

type RequestInfo struct {
	Name       string
	URI        string
	StatusCode int
	Error      error

	Resolving  time.Duration
	Connecting time.Duration
	Sending    time.Duration
	Waiting    time.Duration
	Receiving  time.Duration
	Total      time.Duration

	BodySize int
	// contains filtered or unexported fields
}

RequestInfo contains the different timings involved in sending an HTTP request and its response

func NewRequestInfo

func NewRequestInfo() *RequestInfo

NewRequestInfo creates a new RequestInfo

func (*RequestInfo) ConnectDone

func (t *RequestInfo) ConnectDone()

ConnectDone sets the connection time

func (*RequestInfo) DNSDone

func (t *RequestInfo) DNSDone()

DNSDone sets the resolving time

func (*RequestInfo) DNSStart

func (t *RequestInfo) DNSStart()

DNSStart starts the resolution timer

func (*RequestInfo) GotFirstResponseByte

func (t *RequestInfo) GotFirstResponseByte()

GotFirstResponseByte sets the waiting time

func (*RequestInfo) IsOk added in v1.4.0

func (t *RequestInfo) IsOk() bool

IsOk returns true if the request succeeded

func (*RequestInfo) Lock added in v1.4.0

func (t *RequestInfo) Lock()

Lock locks the RequestInfo mutex

func (*RequestInfo) RequestDone

func (t *RequestInfo) RequestDone(statusCode int)

RequestDone sets the receiving time

func (*RequestInfo) RequestStart

func (t *RequestInfo) RequestStart(name, uri string)

RequestStart starts the timer

func (*RequestInfo) Unlock added in v1.4.0

func (t *RequestInfo) Unlock()

Unlock unlocks the RequestInfo mutex

func (*RequestInfo) WroteRequest

func (t *RequestInfo) WroteRequest()

WroteRequest sets the writing time

Jump to

Keyboard shortcuts

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