diff --git a/r2/r2/lib/stats.py b/r2/r2/lib/stats.py index 64d29a532..7f5aaef40 100644 --- a/r2/r2/lib/stats.py +++ b/r2/r2/lib/stats.py @@ -53,7 +53,8 @@ class TimingStatBuffer: def flush(self): """Yields accumulated timing and counter data and resets the buffer.""" data, self.data = self.data, collections.defaultdict(complex) - for k, v in data.iteritems(): + while data: + k, v = data.popitem() total_time, count = v.real, v.imag yield k, str(int(count)) + '|c' divisor = count or 1