MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / BenchmarkRPCComponents

Function BenchmarkRPCComponents

rpc/pool_test.go:94–117  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

92}
93
94func BenchmarkRPCComponents(b *testing.B) {
95 originLevel := log.GetLevel()
96 defer log.SetLevel(originLevel)
97 log.SetLevel(log.FatalLevel)
98 nodes, stop, err := setupEnvironment(1, AcceptNAConn)
99 if err != nil {
100 b.Fatal("failed to setup servers")
101 }
102 defer stop()
103
104 b.Run("CallerWithPool", func(b *testing.B) {
105 pool := &ClientPool{}
106 defer func() { _ = pool.Close() }()
107 benchCaller(b, NewCallerWithPool(pool), nodes[0].ID)
108 })
109 b.Run("CallerWithoutPool", func(b *testing.B) {
110 benchCaller(b, NewCallerWithPool(&nilPool{}), nodes[0].ID)
111 })
112 b.Run("PCaller", func(b *testing.B) {
113 pool := &ClientPool{}
114 defer func() { _ = pool.Close() }()
115 benchPCaller(b, NewPersistentCallerWithPool(pool, nodes[0].ID))
116 })
117}
118
119func TestRPCComponents(t *testing.T) {
120 Convey("Setup a single server for pool test", t, func(c C) {

Callers

nothing calls this directly

Calls 9

CloseMethod · 0.95
GetLevelFunction · 0.92
SetLevelFunction · 0.92
setupEnvironmentFunction · 0.85
benchCallerFunction · 0.85
NewCallerWithPoolFunction · 0.85
benchPCallerFunction · 0.85
FatalMethod · 0.80

Tested by

no test coverage detected