func (s *ProxySuite) SetUpTest(c *C) { x := DefaultConfig() x.TraceKey = "my_trace_key" mocksController := gomock.NewController(c) s.r = NewRegistry(x, test.NewMockCFMessageBus(mocksController)) s.p = NewProxy(x, s.r, nullVarz{}) s.done = make(chan bool) }
func (s *RegistrySuite) SetUpTest(c *C) { var configObj *Config configObj = DefaultConfig() configObj.DropletStaleThreshold = 1 s.mocksController = gomock.NewController(c) s.messageBus = test.NewMockCFMessageBus(s.mocksController) s.Registry = NewRegistry(configObj, s.messageBus) }
func BenchmarkRegister(b *testing.B) { c := DefaultConfig() mocksController := gomock.NewController(b) r := NewRegistry(c, test.NewMockCFMessageBus(mocksController)) p := NewProxy(c, r, NewVarz(r)) for i := 0; i < b.N; i++ { str := strconv.Itoa(i) rm := ®istryMessage{ Host: "localhost", Port: uint16(i), Uris: []Uri{Uri("bench.vcap.me." + str)}, } p.Register(rm) } }
func (s *VarzSuite) SetUpTest(c *C) { mocksController := gomock.NewController(c) r := NewRegistry(DefaultConfig(), test.NewMockCFMessageBus(mocksController)) s.Registry = r s.Varz = NewVarz(r) }