Skip to content

Commit

Permalink
change cmd for profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Nov 21, 2024
1 parent 7f05b99 commit 5c9c145
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 5 additions & 9 deletions ElvUI/Core/General/Commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ do
if all then
local total = info.total or 0
local percent = (total / all.total) * 100
text = format('%s%s > count: %d | total: %0.2fms (addon %0.2f%%)\n', text, info.module or '', info.count or 0, total, percent)
text = format('%s%s [count: %d] total: %0.3f (addon %0.2f%%)\n', text, info.module or '', info.count or 0, total, percent)
end
elseif full then
local total = info.total or 0
Expand All @@ -98,7 +98,7 @@ do
allPercent = (total / all.total) * 100
end

text = format('%s%s:%s > count: %d | avg: %0.4fms | high: %0.4fms | total: %0.2fms (module %0.2f%% | addon %0.2f%%)\n', text, info.module or '', info.key or '', info.count or 0, info.average or 0, info.high or 0, total, modulePercent, allPercent or 0)
text = format('%s%s:%s [count %d] time %0.3f avg %0.3f total %0.3f (module %0.2f%% addon %0.2f%%)\n', text, info.module or '', info.key or '', info.count or 0, info.finish or 0, info.average or 0, total, modulePercent, allPercent or 0)
end
end

Expand All @@ -111,15 +111,11 @@ do
end

function E:ProfilerSort(second)
if self.total == second.total and self.high == self.high then
return self.count > second.count
if self.count == second.count then
return self.total > second.total
end

if self.total == second.total then
return self.high > second.high
end

return self.total > second.total
return self.count > second.count
end

function E:SortProfilerData(module, data, overall)
Expand Down
4 changes: 2 additions & 2 deletions ElvUI_Libraries/Core/oUF/simpy/profiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ local Generate = function(object, key, func)

local obj = _data[object]
if not obj then
obj = { _module = { total = 0, count = 0 } }
obj = { _module = { total = 0, average = 0, count = 0 } }

if object == Private then
_info.oUF_Private = obj -- only export timing data
Expand All @@ -48,7 +48,7 @@ local Generate = function(object, key, func)
data.total = data.total + finish
data.average = data.total / data.count
else
data = { high = finish, low = finish, total = 0, count = 1 }
data = { high = finish, low = finish, total = finish, average = finish, count = 1 }
obj[key] = data
end

Expand Down

0 comments on commit 5c9c145

Please sign in to comment.