comparison mod_munin/mod_munin.lua @ 1692:44ddec97ad82

mod_munin: Use string.format flag instead of tostring when reporting values
author Kim Alvefur <zash@zash.se>
date Tue, 05 May 2015 01:37:21 +0200
parents accbf0db0246
children effd909d05b0
comparison
equal deleted inserted replaced
1691:1a8c791d365f 1692:44ddec97ad82
68 function munin_commands.fetch(conn, line) 68 function munin_commands.fetch(conn, line)
69 local stat = line:match("%s(%S+)"); 69 local stat = line:match("%s(%S+)");
70 if not stat then conn:write("# Unknown service\n.\n"); return end 70 if not stat then conn:write("# Unknown service\n.\n"); return end
71 for _, name, value in data:iter(stat, nil) do 71 for _, name, value in data:iter(stat, nil) do
72 if not ignore_stats:contains(name) then 72 if not ignore_stats:contains(name) then
73 conn:write(s_format("%s.value %s\n", name, tostring(value))); 73 conn:write(s_format("%s.value %.12f\n", name, value));
74 end 74 end
75 end 75 end
76 conn:write(".\n"); 76 conn:write(".\n");
77 end 77 end
78 78