# HG changeset patch # User Kim Alvefur # Date 1430779735 -7200 # Node ID 99fa40d498cc05f5d3d5663c98377f215776aa89 # Parent 999434eb1bbfca64b61d34619e973c7d80bfc53b util.statistics: Collect duration sample even if run fewer times than the sample interval diff -r 999434eb1bbf -r 99fa40d498cc 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