util.statistics: Collect duration sample even if run fewer times than the sample interval
authorKim Alvefur <zash@zash.se>
Tue, 05 May 2015 00:48:55 +0200
changeset 6652 99fa40d498cc
parent 6651 999434eb1bbf
child 6653 cf15b18e9810
child 6660 f1af4edd5722
util.statistics: Collect duration sample even if run fewer times than the sample interval
util/statistics.lua
--- a/util/statistics.lua	Tue May 05 00:41:39 2015 +0200
+++ b/util/statistics.lua	Tue May 05 00:48:55 2015 +0200
@@ -88,7 +88,7 @@
 
 			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 @@
 
 			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