Skip to content

Commit

Permalink
- fixing an issue with profiling without stop
Browse files Browse the repository at this point in the history
  • Loading branch information
cont1nuity committed Jan 13, 2025
1 parent bd1c236 commit 83a3751
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Plater_ChangeLog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ function Plater.GetChangelogTable()
if (not Plater.ChangeLogTable) then
Plater.ChangeLogTable = {

{1736801633, "Bug Fix", "Jan 13th, 2024", "Fixing an issue with profiling if stop was not used but results should be shown.", "cont1nuity"},

{1736722279, "Bug Fix", "Jan 11th, 2024", "Fixing broken nameplate anchoring for WAs on forced blizzard nameplates (via LibGetFrame).", "cont1nuity"},
{1736722279, "Bug Fix", "Jan 10th, 2024", "Fixing range check for Dark Ranger hunters (via LibRangeCheck).", "cont1nuity"},
{1736722279, "Bug Fix", "Jan 10th, 2024", "Fixing range check for cases when no range can be selected.", "cont1nuity"},
Expand Down
20 changes: 20 additions & 0 deletions Plater_Profiling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ function Plater.EnableProfiling(core)
Plater.EndLogPerformanceCore = EndLogPerformance
end

addonMetricsAtEnd = {} -- reset
addonMetricsAtStart = {}
addonMetricsAtStart.global = {}
addonMetricsAtStart.Plater = {}
Expand Down Expand Up @@ -646,9 +647,24 @@ local function getAdvancedPerfData()
end
end

local resetEndMetrics = false -- in case "stop" was not used, show current snapshot
if not addonMetricsAtEnd.global then
addonMetricsAtEnd = {}
addonMetricsAtEnd.global = {}
addonMetricsAtEnd.Plater = {}
for _, metric in pairs(addonMetricsNames) do
addonMetricsAtEnd.Plater[metric] = C_AddOnProfiler.GetAddOnMetric(addonId, Enum.AddOnProfilerMetric[metric])
end
for _, metric in pairs(addonMetricsNames) do
addonMetricsAtEnd.global[metric] = C_AddOnProfiler.GetOverallMetric(Enum.AddOnProfilerMetric[metric])
end
resetEndMetrics = true
end

local profilingMetrics = {}
profilingMetrics.global = {}
profilingMetrics.Plater = {}

printStrHeader = printStrHeader .. "\n\nAddon Metrics for profiling session:"
printStrHeader = printStrHeader .. "\n\n" .. PRT_INDENT .. "Overall Addon Metrics:\n"
for _, metric in pairs(addonMetricsNamesForSession) do
Expand All @@ -666,6 +682,10 @@ local function getAdvancedPerfData()
end
end

if resetEndMetrics then
addonMetricsAtEnd = {}
end

end

printStrHeader = printStrHeader .. "\n\n"
Expand Down

0 comments on commit 83a3751

Please sign in to comment.