end := time.Now() expectedRate := float64(reporter.SentCounter().GetTotal()) / end.Sub(start).Seconds() Eventually(reporter.Rate()).Should(BeNumerically("~", expectedRate, 0.1)) }) }) Describe("Duration", func() { It("reports test duration", func() { reporter.ReceivedCounter().IncrementValue() time.Sleep(time.Second) reporter.Stop() end := time.Now() Eventually(reporter.Duration()).Should(BeNumerically("~", end.Sub(start), time.Second)) }) }) Describe("Output", func() { Context("with no additional counters", func() { It("increments sent counter", func() { reporter.SentCounter().IncrementValue() reporter.SentCounter().IncrementValue() Eventually(buffer).Should(gbytes.Say("2, 0")) reporter.Stop() }) It("increments received counter", func() { reporter.ReceivedCounter().IncrementValue()