Documentation ¶
Overview ¶
Package test contains helpers for setting up test utilties.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBenchOutput ¶
NewBenchOutput creates a new BenchOutput output type.
func StartPrintingBenchmarks ¶
StartPrintingBenchmarks starts a goroutine that will periodically print any statistics/benchmarks that are accumulated through messages. You must provide the messages via the write channel returned by the function.
Types ¶
type Bench ¶
type Bench struct { Latency int // Time taken (ns) for a message to be received by a consumer NBytes int // Number of bytes carried in the message Index uint64 // The index carried by a message, can be used to detect loss }
Bench is a struct carrying message specific benchmarking statistics.
type BenchOutput ¶
type BenchOutput struct {
// contains filtered or unexported fields
}
BenchOutput is an output type that prints benchmark information to stdout.
func (*BenchOutput) CloseAsync ¶
func (o *BenchOutput) CloseAsync()
CloseAsync shuts down the File output and stops processing messages.
func (*BenchOutput) ResponseChan ¶
func (o *BenchOutput) ResponseChan() <-chan types.Response
ResponseChan returns the errors channel.
func (*BenchOutput) StartReceiving ¶
func (o *BenchOutput) StartReceiving(msgs <-chan types.Message) error
StartReceiving assigns a messages channel for the output to read.
func (*BenchOutput) WaitForClose ¶
func (o *BenchOutput) WaitForClose(timeout time.Duration) error
WaitForClose blocks until the File output has closed down.