Comparison

plugins/mod_admin_shell.lua @ 10902:5d113332855c

mod_admin_shell: Skip multiplier adjustment for rates
author Kim Alvefur <zash@zash.se>
date Thu, 04 Jun 2020 16:54:52 +0200
parent 10887:3debe04a6162
child 10918:b0038e404e0e
comparison
equal deleted inserted replaced
10901:5e33926f4b43 10902:5d113332855c
1316 elseif type == "size" then 1316 elseif type == "size" then
1317 unit = "bytes"; 1317 unit = "bytes";
1318 elseif type == "rate" then 1318 elseif type == "rate" then
1319 unit = " events/sec" 1319 unit = " events/sec"
1320 if ref_value < 0.9 then 1320 if ref_value < 0.9 then
1321 unit = " events/min" 1321 unit = "events/min"
1322 value = value*60; 1322 value = value*60;
1323 if ref_value < 0.6/60 then 1323 if ref_value < 0.6/60 then
1324 unit = " events/h" 1324 unit = "events/h"
1325 value = value*60; 1325 value = value*60;
1326 end 1326 end
1327 end 1327 end
1328 return ("%.3g %s"):format(value, unit);
1328 end 1329 end
1329 end 1330 end
1330 return format_number(value, short_units[unit] or unit or "", unit == "bytes" and 'b' or nil); 1331 return format_number(value, short_units[unit] or unit or "", unit == "bytes" and 'b' or nil);
1331 end 1332 end
1332 1333