From 646f9e84bcf7b3da0bd9bcc2f1eeed9de265aa5c Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Fri, 3 Apr 2015 12:10:30 +0200
Subject: util.datamanager: Fix traceback due to %s in log message

---
 util/datamanager.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'util')

diff --git a/util/datamanager.lua b/util/datamanager.lua
index b82349f1..b4138638 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -293,7 +293,7 @@ function users(host, store, typ)
 
 	local mode, err = lfs.attributes(store_dir, "mode");
 	if not mode then
-		return function() log("debug", err or (store_dir .. " does not exist")) end
+		return function() log("debug", "%s", err or (store_dir .. " does not exist")) end
 	end
 	local next, state = lfs.dir(store_dir);
 	return function(state)
-- 
cgit v1.2.3


From 79d62137f4f324cd4b8f7c2ecd9c2654193cf5a0 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Tue, 5 May 2015 00:41:39 +0200
Subject: util.events: Add local reference to table.remove (fixes traceback)

---
 util/events.lua | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'util')

diff --git a/util/events.lua b/util/events.lua
index 79de1151..81fbc13f 100644
--- a/util/events.lua
+++ b/util/events.lua
@@ -9,6 +9,7 @@
 
 local pairs = pairs;
 local t_insert = table.insert;
+local t_remove = table.remove;
 local t_sort = table.sort;
 local setmetatable = setmetatable;
 local next = next;
@@ -118,7 +119,7 @@ function new()
 		if not w then return; end
 		for i = #w, 1 do
 			if w[i] == wrapper then
-				table.remove(w, i);
+				t_remove(w, i);
 			end
 		end
 		if #w == 0 then
-- 
cgit v1.2.3


From 143926f0a877edff6f91f4820215a24f4edfc69a Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
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')

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