def test_fork(self): collection = stats.fork() stats.incr("widgets", 5) self.assertEquals({"widgets": 5}, collection.get_counter_stats()) self.assertEquals({"widgets": 5}, stats.get_counter_stats(reset=True)) stats.incr("widgets", 5) self.assertEquals({"widgets": 10}, collection.get_counter_stats()) self.assertEquals({"widgets": 5}, stats.get_counter_stats(reset=True))
def test_counters(self): stats.incr("widgets", 1) stats.incr("wodgets", 12) stats.incr("wodgets") self.assertEquals({"widgets": 1, "wodgets": 13}, stats.get_counter_stats())