diff --git a/r2/r2/lib/stats.py b/r2/r2/lib/stats.py index e318c8eec..f533953d2 100644 --- a/r2/r2/lib/stats.py +++ b/r2/r2/lib/stats.py @@ -126,7 +126,9 @@ class Stats: for key, (total_time, count) in events: data['cassandra.' + key] = str(count) + '|c' if key.endswith('.ok'): - data['cassandra.' + key[:-3]] = str(total_time) + '|ms' + divisor = count or 1 + mean = total_time / divisor + data['cassandra.' + key[:-3]] = str(mean) + '|ms' self.connection.send(data) class CacheStats: