Beispiel #1
0
	. "github.com/cloudfoundry-incubator/routing-api/metrics"
	fake_statsd "github.com/cloudfoundry-incubator/routing-api/metrics/fakes"
	"github.com/cloudfoundry/storeadapter"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Metrics", func() {
	Describe("Watch", func() {

		var (
			database    *fake_db.FakeDB
			reporter    *MetricsReporter
			stats       *fake_statsd.FakePartialStatsdClient
			resultsChan chan storeadapter.WatchEvent
			sigChan     chan os.Signal
			readyChan   chan struct{}
			tickChan    chan time.Time
		)

		BeforeEach(func() {
			database = &fake_db.FakeDB{}
			stats = &fake_statsd.FakePartialStatsdClient{}

			tickChan = make(chan time.Time, 1)
			reporter = NewMetricsReporter(database, stats, &time.Ticker{C: tickChan})

			sigChan = make(chan os.Signal, 1)
			readyChan = make(chan struct{}, 1)
			resultsChan = make(chan storeadapter.WatchEvent, 1)