test

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package test - Helpers for setting up test utilties.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBenchMessage

func NewBenchMessage(index int32, dataBlob []byte) types.Message

NewBenchMessage - Create a message carrying information used to calc benchmarks on the other end of a transport.

func StartPrintingBenchmarks

func StartPrintingBenchmarks(period time.Duration, startIndex int32) chan<- Bench

StartPrintingBenchmarks - Starts a goroutine that will periodically print any statistics/benchmarks that are accumulated through messages, and also any lost interactions as per the startIndex. If you want to disable data loss detection then set the startIndex to -1. 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 the consumer.
	NBytes  int   // Number of bytes carried in the message.
	Index   int32 // The index carried by the message, can be used to detect loss.
}

Bench - A struct carrying message specific benchmarking statistics.

func BenchFromMessage

func BenchFromMessage(msg types.Message) (Bench, error)

BenchFromMessage - Returns the benchmarking stats from a message received.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL