"expvar" "net/http" "os" "github.com/cloudfoundry-incubator/garden-linux/metrics" "github.com/cloudfoundry-incubator/garden-linux/metrics/fakes" "github.com/pivotal-golang/lager" "github.com/tedsuo/ifrit" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Debug", func() { var ( serverProc ifrit.Process fakeMetrics *fakes.FakeMetrics ) BeforeEach(func() { var err error fakeMetrics = new(fakes.FakeMetrics) fakeMetrics.NumCPUReturns(11) fakeMetrics.NumGoroutineReturns(888) fakeMetrics.LoopDevicesReturns(33) fakeMetrics.BackingStoresReturns(12) fakeMetrics.DepotDirsReturns(3) sink := lager.NewReconfigurableSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG), lager.DEBUG) serverProc, err = metrics.StartDebugServer("127.0.0.1:5123", sink, fakeMetrics) Expect(err).ToNot(HaveOccurred())
"github.com/cloudfoundry-incubator/garden-linux/metrics/fakes" "github.com/cloudfoundry/dropsonde/metric_sender/fake" dropsonde_metrics "github.com/cloudfoundry/dropsonde/metrics" "github.com/pivotal-golang/clock/fakeclock" "github.com/pivotal-golang/lager/lagertest" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("PeriodicMetronNotifier", func() { var ( sender *fake.FakeMetricSender fakeMetrics *fakes.FakeMetrics reportInterval time.Duration fakeClock *fakeclock.FakeClock pmn *metrics.PeriodicMetronNotifier ) BeforeEach(func() { reportInterval = 100 * time.Millisecond fakeMetrics = new(fakes.FakeMetrics) fakeMetrics.LoopDevicesReturns(33) fakeMetrics.BackingStoresReturns(12) fakeMetrics.DepotDirsReturns(3) fakeClock = fakeclock.NewFakeClock(time.Unix(123, 456))