test

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2017 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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