aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-05-05 01:34:20 +0200
committerKim Alvefur <zash@zash.se>2015-05-05 01:34:20 +0200
commit83049e63c621c66da5129449f3a610df2e74ce38 (patch)
tree0d7008e74a3ae1c6dd45d705691566a9a685d2f7 /util
parent8896368c298dc1d009dc56b38919e02b35f3214d (diff)
parent143926f0a877edff6f91f4820215a24f4edfc69a (diff)
downloadprosody-83049e63c621c66da5129449f3a610df2e74ce38.tar.gz
prosody-83049e63c621c66da5129449f3a610df2e74ce38.zip
Merge 0.10->trunk
Diffstat (limited to 'util')
-rw-r--r--util/events.lua3
-rw-r--r--util/statistics.lua4
2 files changed, 4 insertions, 3 deletions
diff --git a/util/events.lua b/util/events.lua
index 79de1151..81fbc13f 100644
--- a/util/events.lua
+++ b/util/events.lua
@@ -9,6 +9,7 @@
local pairs = pairs;
local t_insert = table.insert;
+local t_remove = table.remove;
local t_sort = table.sort;
local setmetatable = setmetatable;
local next = next;
@@ -118,7 +119,7 @@ function new()
if not w then return; end
for i = #w, 1 do
if w[i] == wrapper then
- table.remove(w, i);
+ t_remove(w, i);
end
end
if #w == 0 then
diff --git a/util/statistics.lua b/util/statistics.lua
index a05a1f91..26355026 100644
--- a/util/statistics.lua
+++ b/util/statistics.lua
@@ -88,7 +88,7 @@ local function new_registry(config)
return function (value)
n_actual_events = n_actual_events + 1;
- if n_actual_events%duration_sample_interval > 0 then
+ if n_actual_events%duration_sample_interval == 1 then
last_event = (last_event%duration_max_samples) + 1;
events[last_event] = value;
end
@@ -113,7 +113,7 @@ local function new_registry(config)
return function ()
n_actual_events = n_actual_events + 1;
- if n_actual_events%duration_sample_interval > 0 then
+ if n_actual_events%duration_sample_interval ~= 1 then
return nop_function;
end