aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_shell.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-06-04 16:54:52 +0200
committerKim Alvefur <zash@zash.se>2020-06-04 16:54:52 +0200
commitf86aaa431f2135df07ea543060fb9457b5654639 (patch)
tree6e3ee01143c7f77aa516ba17c42d79142fd25bf1 /plugins/mod_admin_shell.lua
parent2155ef819e0e9cd1d43ea52c6f4f76ff921a3ff7 (diff)
downloadprosody-f86aaa431f2135df07ea543060fb9457b5654639.tar.gz
prosody-f86aaa431f2135df07ea543060fb9457b5654639.zip
mod_admin_shell: Skip multiplier adjustment for rates
Diffstat (limited to 'plugins/mod_admin_shell.lua')
-rw-r--r--plugins/mod_admin_shell.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua
index afbd2922..f3672496 100644
--- a/plugins/mod_admin_shell.lua
+++ b/plugins/mod_admin_shell.lua
@@ -1318,13 +1318,14 @@ local function format_stat(type, unit, value, ref_value)
elseif type == "rate" then
unit = " events/sec"
if ref_value < 0.9 then
- unit = " events/min"
+ unit = "events/min"
value = value*60;
if ref_value < 0.6/60 then
- unit = " events/h"
+ unit = "events/h"
value = value*60;
end
end
+ return ("%.3g %s"):format(value, unit);
end
end
return format_number(value, short_units[unit] or unit or "", unit == "bytes" and 'b' or nil);