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

Function TestStdDev

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

Source from the content-addressed store, hash-verified

141}
142
143func TestStdDev(t *testing.T) {
144 sg := NewSampleGroup()
145 sg.AddSample(millionMessagesSecondSample(1))
146 sg.AddSample(millionMessagesSecondSample(2))
147 sg.AddSample(millionMessagesSecondSample(3))
148 if sg.StdDev() != 0.0 {
149 t.Fatal("Expected stddev to be zero")
150 }
151}
152
153func TestBenchSetup(t *testing.T) {
154 bench := NewBenchmark("test", 1, 1)

Callers

nothing calls this directly

Calls 4

AddSampleMethod · 0.95
StdDevMethod · 0.95
NewSampleGroupFunction · 0.85

Tested by

no test coverage detected