util.statistics: Collect duration sample even if run fewer times than the sample interval

This commit is contained in:
Kim Alvefur 2015-05-05 00:48:55 +02:00
parent 3270779149
commit 9699e09082

View file

@ -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