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

Function TestBenchStrings

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

Source from the content-addressed store, hash-verified

202}
203
204func TestBenchStrings(t *testing.T) {
205 bench := makeBench(1, 1)
206 s := bench.Report()
207 lines := strings.Split(s, "\n")
208 if len(lines) != 4 {
209 t.Fatal("Expected 3 lines of output: header, pub, sub, empty")
210 }
211
212 bench = makeBench(2, 2)
213 s = bench.Report()
214 lines = strings.Split(s, "\n")
215 if len(lines) != 10 {
216 fmt.Printf("%q\n", s)
217
218 t.Fatal("Expected 11 lines of output: header, pub header, pub x 2, stats, sub headers, sub x 2, stats, empty")
219 }
220}
221
222func TestMsgsPerClient(t *testing.T) {
223 zero := MsgsPerClient(0, 0)

Callers

nothing calls this directly

Calls 2

makeBenchFunction · 0.85
ReportMethod · 0.80

Tested by

no test coverage detected