Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HumanBytes ¶
HumanBytes formats bytes as a human readable string
func MsgsPerClient ¶
MsgsPerClient divides the number of messages by the number of clients and tries to distribute them as evenly as possible
Types ¶
type Benchmark ¶
type Benchmark struct { Sample Name string RunID string Pubs *SampleGroup Subs *SampleGroup // contains filtered or unexported fields }
Benchmark to hold the various Samples organized by publishers and subscribers
func NewBenchmark ¶
NewBenchmark initializes a Benchmark. After creating a bench call AddSubSample/AddPubSample. When done collecting samples, call EndBenchmark
func (*Benchmark) AddPubSample ¶
AddPubSample to the benchmark
func (*Benchmark) AddSubSample ¶
AddSubSample to the benchmark
type Sample ¶
type Sample struct { JobMsgCnt int MsgCnt uint64 MsgBytes uint64 IOBytes uint64 Start time.Time End time.Time }
A Sample for a particular client
func NewSample ¶
NewSample creates a new Sample initialized to the provided values. The nats.Conn information captured
type SampleGroup ¶
SampleGroup for a number of samples, the group is a Sample itself agregating the values the Samples
func (*SampleGroup) AddSample ¶
func (sg *SampleGroup) AddSample(e *Sample)
AddSample adds a Sample to the SampleGroup. After adding a Sample it shouldn't be modified.
func (*SampleGroup) AvgRate ¶
func (sg *SampleGroup) AvgRate() int64
AvgRate returns the average of all the message rates in the SampleGroup
func (*SampleGroup) HasSamples ¶
func (sg *SampleGroup) HasSamples() bool
HasSamples returns true if the group has samples
func (*SampleGroup) MaxRate ¶
func (sg *SampleGroup) MaxRate() int64
MaxRate returns the largest message rate in the SampleGroup
func (*SampleGroup) MinRate ¶
func (sg *SampleGroup) MinRate() int64
MinRate returns the smallest message rate in the SampleGroup
func (*SampleGroup) Statistics ¶
func (sg *SampleGroup) Statistics() string
Statistics information of the sample group (min, average, max and standard deviation)
func (*SampleGroup) StdDev ¶
func (sg *SampleGroup) StdDev() float64
StdDev returns the standard deviation the message rates in the SampleGroup