aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-05-05 00:48:55 +0200
committerKim Alvefur <zash@zash.se>2015-05-05 00:48:55 +0200
commit9699e09082cb84af5e2c74c05d162438a4c6d536 (patch)
tree923cbc6ca97a211442dfde13a093190a4bb42bd9
parent32707791498b7bb2437753b296f33d8348c06423 (diff)
downloadprosody-9699e09082cb84af5e2c74c05d162438a4c6d536.tar.gz
prosody-9699e09082cb84af5e2c74c05d162438a4c6d536.zip
util.statistics: Collect duration sample even if run fewer times than the sample interval
-rw-r--r--util/statistics.lua4
1 files changed, 2 insertions, 2 deletions
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