Mercurial > prosody-hg
diff util/statistics.lua @ 10411:db2a06b9ff98
Merge 0.11->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 16 Nov 2019 16:52:31 +0100 |
| parents | bbc879eab1bf |
| children | d75d805c852f |
line wrap: on
line diff
--- a/util/statistics.lua Sat Nov 16 16:45:33 2019 +0100 +++ b/util/statistics.lua Sat Nov 16 16:52:31 2019 +0100 @@ -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;
