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

Function TestGroupSeconds

bench/benchlib_test.go:92–101  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

90}
91
92func TestGroupSeconds(t *testing.T) {
93 sg := NewSampleGroup()
94 sg.AddSample(millionMessagesSecondSample(1))
95 sg.AddSample(millionMessagesSecondSample(2))
96 sg.AddSample(millionMessagesSecondSample(3))
97 seconds := sg.End.Sub(sg.Start).Seconds()
98 if seconds != sg.Seconds() || seconds != 3.0 {
99 t.Fatal("Expected aggregate seconds to be 3.0 seconds")
100 }
101}
102
103func TestGroupRate(t *testing.T) {
104 sg := NewSampleGroup()

Callers

nothing calls this directly

Calls 4

AddSampleMethod · 0.95
NewSampleGroupFunction · 0.85
SecondsMethod · 0.80

Tested by

no test coverage detected