# HG changeset patch # User Link Mauve # Date 1769781865 -3600 # Node ID 268220ce06255da75aa0d758b7522b62ee3d61ca # Parent 919f26901b5173946f355771d1dc754cbbb4fec5 mod_prometheus: Switch to prosody.util.time.now() to get the current time diff -r 919f26901b51 -r 268220ce0625 mod_prometheus/mod_prometheus.lua --- a/mod_prometheus/mod_prometheus.lua Fri Jan 30 15:04:22 2026 +0100 +++ b/mod_prometheus/mod_prometheus.lua Fri Jan 30 15:04:25 2026 +0100 @@ -11,7 +11,7 @@ local tostring = tostring; local t_insert = table.insert; local t_concat = table.concat; -local socket = require "socket"; +local time_now = require "prosody.util.time".now; local statsman = require "core.statsmanager"; local get_stats = statsman.get_stats; local get_metric_registry = statsman.get_metric_registry; @@ -26,8 +26,8 @@ end local function get_timestamp() - -- Using LuaSocket for that because os.time() only has second precision. - return math.floor(socket.gettime() * 1000); + -- In milliseconds. + return math.floor(time_now() * 1000); end local function repr_help(metric, docstring)