# HG changeset patch # User Emmanuel Gil Peyrot # Date 1529612115 -7200 # Node ID a34e7bd87b39f32f93599f1ef380997cd19f20e8 # Parent 36770ae1148fc6234935ca88e8ef9bb8335a070f mod_prometheus: Optimise global lookups. diff -r 36770ae1148f -r a34e7bd87b39 mod_prometheus/mod_prometheus.lua --- a/mod_prometheus/mod_prometheus.lua Thu Jun 21 22:14:12 2018 +0200 +++ b/mod_prometheus/mod_prometheus.lua Thu Jun 21 22:15:15 2018 +0200 @@ -7,8 +7,10 @@ module:set_global(); module:depends "http"; +local tostring = tostring; local s_format = string.format; local t_insert = table.insert; +local t_concat = table.concat; local socket = require "socket"; local mt = require "util.multitable"; @@ -54,7 +56,7 @@ if #values == 0 then return ""; end - return "{"..table.concat(values, ", ").."}"; + return "{"..t_concat(values, ", ").."}"; end local function repr_sample(metric, labels, value, timestamp) @@ -112,7 +114,7 @@ t_insert(answer, repr_sample(name, {}, value, timestamp)); end end - return table.concat(answer, ""); + return t_concat(answer, ""); end function module.add_host(module)