From 143926f0a877edff6f91f4820215a24f4edfc69a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 5 May 2015 00:48:55 +0200 Subject: util.statistics: Collect duration sample even if run fewer times than the sample interval --- util/statistics.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/statistics.lua') 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 -- cgit v1.2.3