MCPcopy
hub / github.com/nats-io/nats.go / millionMessagesSecondSample

Function millionMessagesSecondSample

bench/benchlib_test.go:32–43  ·  view source on GitHub ↗
(seconds int)

Source from the content-addressed store, hash-verified

30var baseTime = time.Now()
31
32func millionMessagesSecondSample(seconds int) *Sample {
33 messages := Million * seconds
34 start := baseTime
35 end := start.Add(time.Second * time.Duration(seconds))
36 nc := new(nats.Conn)
37
38 s := NewSample(messages, MsgSize, start, end, nc)
39 s.MsgCnt = uint64(messages)
40 s.MsgBytes = uint64(messages * MsgSize)
41 s.IOBytes = s.MsgBytes
42 return s
43}
44
45func TestDuration(t *testing.T) {
46 s := millionMessagesSecondSample(1)

Callers 14

TestDurationFunction · 0.85
TestSecondsFunction · 0.85
TestRateFunction · 0.85
TestThoughputFunction · 0.85
TestStringsFunction · 0.85
TestGroupDurationFunction · 0.85
TestGroupSecondsFunction · 0.85
TestGroupRateFunction · 0.85
TestGroupThoughputFunction · 0.85
TestMinMaxRateFunction · 0.85
TestAvgRateFunction · 0.85
TestStdDevFunction · 0.85

Calls 3

NewSampleFunction · 0.85
DurationMethod · 0.80
AddMethod · 0.65

Tested by

no test coverage detected