# HG changeset patch # User Emmanuel Gil Peyrot # Date 1570719482 -7200 # Node ID bbc879eab1bfc5b21f0032a871eedf0ea96625db # Parent b52f916e1813de5edc9cdffddd815989a0c00c6b util.statistics: Add a total count for rate counters, counting from server start. diff -r b52f916e1813 -r bbc879eab1bf util/statistics.lua --- a/util/statistics.lua Wed Oct 09 23:20:22 2019 +0200 +++ b/util/statistics.lua Thu Oct 10 16:58:02 2019 +0200 @@ -57,12 +57,14 @@ end; end; rate = function (name) - local since, n = time(), 0; + local since, n, total = time(), 0, 0; registry[name..":rate"] = function () + total = total + n; local t = time(); local stats = { rate = n/(t-since); count = n; + total = total; }; since, n = t, 0; return "rate", stats.rate, stats;