def test_hll_counter(self):
        counter = HyperLogLogCounter(key='test_key')
        counter.setup(redis_conn=self.redis_conn)
        for n in range(3):
            i = 0
            while i < 10010 * (n + 1):
                counter.increment(i % (5000 * (n + 1)))
                i += 1

            value = 5000 * (n + 1)
            actual = counter.value()
            diff = self.get_percent_diff(value, actual)
            self.assertLessEqual(diff, self.tolerance)
            self.clean_keys(counter.key)

        counter.stop()
dataset/ETHPy150Open istresearch/scrapy-cluster/utils/tests/tests_online.py/TestStatsHyperLogLogCounter.test_hll_counter/original