func (s *ProxySuite) SetUpTest(c *C) { x := config.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.Config configObj = config.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 := config.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(config.DefaultConfig(), test.NewMockCFMessageBus(mocksController)) s.Registry = r s.Varz = NewVarz(r) }