Initial commit

This commit is contained in:
Dorian Wouters 2016-08-10 21:57:08 +02:00
commit fa7aa3d6c5
No known key found for this signature in database
GPG Key ID: 6E9DA8063322434B
2 changed files with 16 additions and 0 deletions

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# profilerdumper
Minetest mod that runs `/profiler dump` every `profilerdumper.interval` seconds (defaults to 5 min).
WTFPL / CC0 / Public Domain

11
init.lua Normal file
View File

@ -0,0 +1,11 @@
if minetest.chatcommands['profiler'] then
local function get_interval()
return minetest.setting_get('profilerdumper.interval') or 10*60
end
local function loop()
minetest.chatcommands['profiler'].func(nil, 'dump')
minetest.after(get_interval(), loop)
end
minetest.after(get_interval(), loop)
minetest.log('action', '[profilerdumper] Started with initial interval of ' .. get_interval())
end