aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-03-20 00:48:28 +0100
committerKim Alvefur <zash@zash.se>2017-03-20 00:48:28 +0100
commit2200724140d472766c3e78bab761f9cbce97b020 (patch)
treebaa76027e2950ac788347cbda919e81abc010108
parentfb586ecffc730c4ab451936d4172086e673c931e (diff)
downloadprosody-2200724140d472766c3e78bab761f9cbce97b020.tar.gz
prosody-2200724140d472766c3e78bab761f9cbce97b020.zip
util.statistics,statsd,throttle,timer: Replace dependency on LuaSockect with util.time for precision time
-rw-r--r--util/statistics.lua2
-rw-r--r--util/statsd.lua2
-rw-r--r--util/throttle.lua2
-rw-r--r--util/timer.lua2
4 files changed, 4 insertions, 4 deletions
diff --git a/util/statistics.lua b/util/statistics.lua
index 26355026..39954652 100644
--- a/util/statistics.lua
+++ b/util/statistics.lua
@@ -1,6 +1,6 @@
local t_sort = table.sort
local m_floor = math.floor;
-local time = require "socket".gettime;
+local time = require "util.time".now;
local function nop_function() end
diff --git a/util/statsd.lua b/util/statsd.lua
index e5322de9..67481c36 100644
--- a/util/statsd.lua
+++ b/util/statsd.lua
@@ -1,6 +1,6 @@
local socket = require "socket";
-local time = require "socket".gettime;
+local time = require "util.time".now
local function new(config)
if not config or not config.statsd_server then
diff --git a/util/throttle.lua b/util/throttle.lua
index 3d3f5d2d..18692a8a 100644
--- a/util/throttle.lua
+++ b/util/throttle.lua
@@ -1,5 +1,5 @@
-local gettime = require "socket".gettime;
+local gettime = require "util.time".now
local setmetatable = setmetatable;
local floor = math.floor;
diff --git a/util/timer.lua b/util/timer.lua
index 3713625d..7e2e9414 100644
--- a/util/timer.lua
+++ b/util/timer.lua
@@ -9,7 +9,7 @@
local server = require "net.server";
local math_min = math.min
local math_huge = math.huge
-local get_time = require "socket".gettime;
+local get_time = require "util.time".now
local t_insert = table.insert;
local pairs = pairs;
local type = type;