comparison mod_statistics_statsd/mod_statistics_statsd.lua @ 1656:98a186874806

mod_statistics_statsd: Use module:log()
author Kim Alvefur <zash@zash.se>
date Tue, 07 Apr 2015 22:07:40 +0200
parents b59812aaabad
children
comparison
equal deleted inserted replaced
1655:4d38b8c03dfe 1656:98a186874806
7 7
8 function push_stats(stats, meta) 8 function push_stats(stats, meta)
9 local metric_strings, remaining_bytes = {}, max_datagram_size; 9 local metric_strings, remaining_bytes = {}, max_datagram_size;
10 for name, value in pairs(stats) do 10 for name, value in pairs(stats) do
11 local value_meta = meta[name]; 11 local value_meta = meta[name];
12 log("warn", "%s %s", name, tostring(value_meta)); 12 module:log("warn", "%s %s", name, tostring(value_meta));
13 --if not value_meta then 13 --if not value_meta then
14 -- Simple value (gauge) 14 -- Simple value (gauge)
15 local metric_string = ("%s|%d|g"):format(name, value); 15 local metric_string = ("%s|%d|g"):format(name, value);
16 if #metric_string > remaining_bytes then 16 if #metric_string > remaining_bytes then
17 udp:sendto(table.concat(metric_strings, "\n"), server, server_port); 17 udp:sendto(table.concat(metric_strings, "\n"), server, server_port);