Documentation
¶
Index ¶
- func Upgrade(w http.ResponseWriter, r *http.Request) (*websocket.Conn, error)
- type DefaultMeasurer
- type Measurer
- type Protocol
- func (p *Protocol) ReceiverLoop(ctx context.Context) (<-chan model.WireMeasurement, <-chan model.WireMeasurement, <-chan error)
- func (p *Protocol) ScaleMessage(msgSize int, bytesSent int) int
- func (p *Protocol) SenderLoop(ctx context.Context) (<-chan model.WireMeasurement, <-chan model.WireMeasurement, <-chan error)
- func (p *Protocol) SetByteLimit(value int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultMeasurer ¶
type DefaultMeasurer struct{}
DefaultMeasurer is the default throughput1 measurer that wraps the measurer package's Start function.
func (*DefaultMeasurer) Start ¶
func (*DefaultMeasurer) Start(ctx context.Context, c net.Conn) <-chan model.Measurement
type Protocol ¶
type Protocol struct {
// contains filtered or unexported fields
}
Protocol is the implementation of the throughput1 protocol.
func New ¶
New returns a new Protocol with the specified connection and every other option set to default.
func (*Protocol) ReceiverLoop ¶
func (p *Protocol) ReceiverLoop(ctx context.Context) (<-chan model.WireMeasurement, <-chan model.WireMeasurement, <-chan error)
ReceiverLoop starts the receiver loop of the throughput1 protocol. The context's lifetime determines how long to run for. It returns one channel for sender-side measurements, one channel for receiver-side measurements and one channel for errors. While the measurements channels could be ignored, the errors channel MUST be drained by the caller.
func (*Protocol) ScaleMessage ¶ added in v0.4.0
ScaleMessage sets the binary message size taking into consideration byte limits.
func (*Protocol) SenderLoop ¶
func (p *Protocol) SenderLoop(ctx context.Context) (<-chan model.WireMeasurement, <-chan model.WireMeasurement, <-chan error)
SenderLoop starts the send loop of the throughput1 protocol. The context's lifetime determines how long to run for. It returns one channel for sender-side measurements, one channel for receiver-side measurements and one channel for errors. While the measurements channels could be ignored, the errors channel MUST be drained by the caller.
func (*Protocol) SetByteLimit ¶ added in v0.4.0
SetByteLimit sets the number of bytes sent after which a test (either download or upload) will stop. Set the value to zero to disable the byte limit.