/trunk/VFL/Profilers
-- SUMMARY CPU/Memory PROFILING |
local summary_update_interval = 2; |
local summary_update_interval = 1; |
--- Gets the summary update interval. |
-- This is used for converting to per-second stats. |
for i=3, #alist do |
acpux = alist[i]; |
acpuaindex = acpux.addon_index; |
--if VFLConfig.summary[alist[i].title] then |
acpu = GetAddOnCPUUsage(acpuaindex) / 1000; |
--else |
-- acpu = 0; |
--end |
acpu = GetAddOnCPUUsage(acpuaindex) / 1000; |
acputot = acputot + acpu; |
acpuusage = acpu - acpux.CPU; |
-- Object PROFILING |
local object_update_interval = 3; |
local object_update_interval = 1; |
--- Gets the object update interval. |
-- This is used for converting to per-second stats. |
-- (usage per second = usage per interval * intervals per sec = upi / spi) |
totCPU = 0; totCalls = 0; curCat = obj; |
else |
if obj.type == "function" then |
if obj.object == nil then VFL.print("ERROR"); end |
cpu, calls = GetFunctionCPUUsage(obj.object, obj.includeSubObjects); |
cpu = cpu / 1000; |
--VFL.print(obj.title .. ":" .. cpu); |
elseif obj.type == "frame" then |
cpu, calls = GetFrameCPUUsage(obj.object, obj.includeSubObjects); |
cpu = cpu / 1000; |
VFLP.RegisterCategory("VFL Profiler"); |
VFLP.RegisterFunc("VFL Profiler", "Mem Updater", UpdateMemorySummary, true); |
VFLP.RegisterFunc("VFL Profiler", "CPU Updater", UpdateCPUSummary, true); |
VFLP.RegisterFunc("VFL Profiler", "Event Updater", UpdateEventProfile, true); |
--VFLP.RegisterFunc("VFL Profiler", "Event Updater", UpdateEventProfile, true); |
VFLP.RegisterFunc("VFL Profiler", "Object Updater", UpdateObjProfile, true); |
VFLP.RegisterFunc("VFL Profiler", "Pool Updater", UpdatePoolSummary, true); |
end |
end); |
--ResetCPUUsage() |
function VFLP.ResetCPU() |
ResetCPUUsage() |
end |