Beispiel #1
0
		It("emits total_subscriptions on start", func() {
			Eventually(stats.GaugeCallCount).Should(Equal(1))

			totalStat, count, rate := stats.GaugeArgsForCall(0)
			Expect(totalStat).To(Equal("total_subscriptions"))
			Expect(count).To(BeNumerically("==", 0))
			Expect(rate).To(BeNumerically("==", 1.0))
		})

		It("periodically sends a delta of 0 to total_subscriptions", func() {
			tickChan <- time.Now()

			Eventually(stats.GaugeDeltaCallCount).Should(Equal(1))

			totalStat, count, rate := stats.GaugeDeltaArgsForCall(0)
			Expect(totalStat).To(Equal("total_subscriptions"))
			Expect(count).To(BeNumerically("==", 0))
			Expect(rate).To(BeNumerically("==", 1.0))
		})

		It("periodically gets total routes", func() {
			tickChan <- time.Now()

			Eventually(stats.GaugeCallCount).Should(Equal(2))

			totalStat, count, rate := stats.GaugeArgsForCall(1)
			Expect(totalStat).To(Equal("total_routes"))
			Expect(count).To(BeNumerically("==", 5))
			Expect(rate).To(BeNumerically("==", 1.0))
		})