Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn interface {
net.Conn
// Stats gets the stats over the lifetime of the connection
Stats() *Stats
// FirstError gets the the first unexpected error encountered during network
// processing. If this is not nil, something went wrong.
FirstError() error
// Wrapped() exposes the wrapped net.Conn
Wrapped() net.Conn
}
Conn is a wrapped net.Conn that exposes statistics about transfer data and the first error encountered during processing.
type Stats ¶
type Stats struct {
SentTotal int
SentMin float64
SentMax float64
SentAvg float64
RecvTotal int
RecvMin float64
RecvMax float64
RecvAvg float64
// Duration indicates how long it has been since the connection was opened
// (more precisely, how long it's been since it was wrapped by measured).
Duration time.Duration
}
Stats provides statistics about total transfer and rates, all in bytes.
Click to show internal directories.
Click to hide internal directories.