(15 MB)
Updated: 04-23-15 03:48 AM
Updated:04-23-15 03:48 AM
Created:04-23-15 03:48 AM
Version: 1.0.1
by: Naifu [More]
nkDebug is a small tool to help addons developers during the development process. It's main focus is on improving performance. For this it features an UI which shows you the load of all loaded addons in a list. You can click on one of the entries and a graph will show you how this addon's performance is changing over time.

Below the graph there is another list which can show you the performance of certain methods in your addon. This list includes the values method name, avg. run time, last run time, no of calls and total time of method duration. Using these values you can spot the methods in your addon which take the most time quite easily.

For the method performance part to work you'll need to include two lines into every method (or at least in the methods you want to debug). One at the very beginning and one at the end of these methods:

- At the beginning of the method -

local debugId if nkDebug then debugId = nkDebug.traceStart (addon name, method name) end

- At the end of the method -

if nkDebug then debugId = nkDebug.traceEnd (addon name, method name, debugId) end

If nkDebug is loaded it will start to record this method's performance and calls. If not nothing will happen at all. Instead of entering the addon name all of the time you could include the following line at the very beginning of every lua file of your addon (it has to be the first line at the very top):

local addonInfo, privateVars = ...

Then you can use addonInfo.identifier as addon name and it will automatically read the identifier out of your RiftAddon.toc file.

To make sure nkDebug is loaded before your addon please add the following to the toc of your addon:

Dependencies = { nkDebug = {"optional", "before"} }
Archived Files (1)
File Name
01-01-70 12:00 AM

There have been no comments posted to this file.
Be the first to add one.

Category Jump: