Esempio n. 1
0
			var httpHandler http.Handler

			httpClient = &http.Client{}
			logger = lagertest.NewTestLogger("test")
			bbsClient = new(fake_bbs.FakeClient)
			noaaClient = &fakes.FakeNoaaClient{}

			httpHandler, err = handler.New(bbsClient, noaaClient, 2, 15, logger)
			Expect(err).NotTo(HaveOccurred())

			server = httptest.NewServer(httpHandler)

			fakeActualLRPResponses = make(chan []*models.ActualLRPGroup, 2)

			bbsClient.DesiredLRPByProcessGuidStub = func(string) (*models.DesiredLRP, error) {
				return &models.DesiredLRP{}, nil
			}

			bbsClient.ActualLRPGroupsByProcessGuidStub = func(string) ([]*models.ActualLRPGroup, error) {
				return <-fakeActualLRPResponses, nil
			}

			noaaClient.ContainerMetricsReturns([]*events.ContainerMetric{
				{
					ApplicationId: proto.String("appId"),
					InstanceIndex: proto.Int32(0),
					CpuPercentage: proto.Float64(4),
					MemoryBytes:   proto.Uint64(1024),
					DiskBytes:     proto.Uint64(2048),
				},
			}, nil)