Documentation ¶
Overview ¶
This package contains utilities for testing DCCP and CCID in a controlled, simulated environment.
Index ¶
- Constants
- func NanoToMilli(nano float64) float64
- func NewClientServerPipe(env *dccp.Env) (clientConn, serverConn *dccp.Conn, ...)
- type Measure
- type Moment
- func (x *Moment) Add(sample float64)
- func (x *Moment) AddWeighted(sample float64, weight float64)
- func (x *Moment) Average() float64
- func (x *Moment) Init()
- func (x *Moment) Max() float64
- func (x *Moment) Min() float64
- func (x *Moment) Moment(k float64) float64
- func (x *Moment) StdDev() float64
- func (x *Moment) Variance() float64
- type Pipe
- type TraceWriterPlex
Constants ¶
const ( DefaultRateInterval = 1e9 DefaultRatePacketsPerInterval = 100 )
Variables ¶
This section is empty.
Functions ¶
func NanoToMilli ¶
func NewClientServerPipe ¶
func NewClientServerPipe(env *dccp.Env) (clientConn, serverConn *dccp.Conn, clientToServer, serverToClient *headerHalfPipe)
NewClientServerPipe creates a sandbox communication pipe and attaches a DCCP client and a DCCP server to its endpoints. In addition to sending all emits to a standard DCCP log file, it sends a copy of all emits to the dup TraceWriter.
Types ¶
type Measure ¶
type Measure struct {
// contains filtered or unexported fields
}
Measure is a dccp.TraceWriter which listens to the logs emitted from the Roundtrip. It measures the real roundtrip time between the sender and receiver, based on read and write logs and prints out this information.
type Moment ¶
type Moment struct {
// contains filtered or unexported fields
}
func (*Moment) AddWeighted ¶
type Pipe ¶
type Pipe struct {
// contains filtered or unexported fields
}
Pipe is an in-process commincation channel, whose two ends implement dccp.HeaderConn. It supports rate limiting, latency emulation and receive buffer emulation (in order to capture slow readers).
type TraceWriterPlex ¶
type TraceWriterPlex struct {
// contains filtered or unexported fields
}
TraceWriterPlex is a dccp.TraceWriter that replicates TraceWriter method invocations to a set of TraceWriters
func NewEnv ¶
func NewEnv(guzzleFilename string, guzzles ...dccp.TraceWriter) (env *dccp.Env, plex *TraceWriterPlex)
NewEnv creates a dccp.Env for test purposes, whose dccp.TraceWriter writes to a file and duplicates all emits to any number of additional guzzles, which are usually used to check test conditions. The TraceWriterPlex is returned to facilitate adding further guzzles.
func NewTraceWriterPlex ¶
func NewTraceWriterPlex(guzzles ...dccp.TraceWriter) *TraceWriterPlex
func (*TraceWriterPlex) Add ¶
func (t *TraceWriterPlex) Add(g dccp.TraceWriter)
Add adds an additional guzzle to the plex
func (*TraceWriterPlex) Close ¶
func (t *TraceWriterPlex) Close() error
Close closes all the guzzles in the plex
func (*TraceWriterPlex) HighlightSamples ¶
func (t *TraceWriterPlex) HighlightSamples(samples ...string)
HighlightSamples instructs the guzzle to highlight any records carrying samples of the given names
func (*TraceWriterPlex) Sync ¶
func (t *TraceWriterPlex) Sync() error
Sync syncs all the guzzles in the plex
func (*TraceWriterPlex) Write ¶
func (t *TraceWriterPlex) Write(r *dccp.Trace)