Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoMatchingRequest = errors.New("no matching request") ErrTooManyItems = errors.New("response is larger than request allows") ErrCollision = errors.New("request ID collision") ErrCodeMismatch = errors.New("wrong response code for request") ErrLimitReached = errors.New("request limit reached") ErrStopped = errors.New("tracker stopped") )
Functions ¶
This section is empty.
Types ¶
type Request ¶ added in v1.17.0
type Request struct {
ID uint64 // Request ID
Size int // Number/size of requested items
ReqCode uint64 // Protocol message code of the request
RespCode uint64 // Protocol message code of the expected response
// contains filtered or unexported fields
}
Request tracks sent network requests which have not yet received a response.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker is a pending network request tracker to measure how much time it takes a remote peer to respond.
func New ¶
New creates a new network request tracker to monitor how much time it takes to fill certain requests and how individual peers perform.
func (*Tracker) Fulfil ¶
Fulfil fills a pending request, if any is available, reporting on various metrics.
Click to show internal directories.
Click to hide internal directories.