reporter.GetSentCounter().IncrementValue() reporter.GetReceivedCounter().IncrementValue() Eventually(buffer).Should(gbytes.Say("2, 1")) Eventually(buffer).Should(gbytes.Say("0, 0")) reporter.Stop() }) It("should write averages", func() { reporter.GetSentCounter().IncrementValue() reporter.GetSentCounter().IncrementValue() reporter.GetReceivedCounter().IncrementValue() Eventually(reporter.GetNumTicks, "20ms", "1ms").Should(BeEquivalentTo(1)) reporter.Stop() Expect(reporter.GetNumTicks()).To(BeEquivalentTo(1), "The reporter is writing too quickly") Eventually(buffer).Should(gbytes.Say("Averages: 2, 1, 50%")) }) }) Context("with additional counters", func() { var ( counter1 *metricsreporter.Counter counter2 *metricsreporter.Counter ) BeforeEach(func() { counter1 = metricsreporter.NewCounter("counter1") counter2 = metricsreporter.NewCounter("counter2")