Initial commit
This commit is contained in:
		
							
								
								
									
										5
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								README.md
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										11
									
								
								init.lua
									
									
									
									
									
										Normal 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
 | 
				
			||||||
		Reference in New Issue
	
	Block a user