Changeset

6649:99fa40d498cc

util.statistics: Collect duration sample even if run fewer times than the sample interval
author Kim Alvefur <zash@zash.se>
date Tue, 05 May 2015 00:48:55 +0200
parents 6648:999434eb1bbf
children 6650:cf15b18e9810 6657:f1af4edd5722
files util/statistics.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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