WowAddons

World of Warcraft Forever API · C_AddOnProfiler.md, for your AI

C_AddOnProfiler

10 functions, 4 tables, as Blizzard documents them for Forever 1.60.1 (70959).

Making an addon with an AI? Tell it: Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it. It checks every call against this API before you try it in the game, then publishes it here. How it works.

Functions

C_AddOnProfiler.AddMeasuredCallEvent

C_AddOnProfiler.AddMeasuredCallEvent(name)

Adds a measured event to any ongoing measured calls. If no such calls are currently taking place, this function does nothing.

Arguments

namestringViewUser-defined string describing the measured event. This should be kept under 48 bytes to avoid memory allocations.

C_AddOnProfiler.AddPerformanceMessageShown

C_AddOnProfiler.AddPerformanceMessageShown(msg)

Internal API for telemetry.

Arguments

msgAddOnPerformanceMessage

C_AddOnProfiler.CheckForPerformanceMessage

msg = C_AddOnProfiler.CheckForPerformanceMessage()

Optimized check for determining if AddOns are severely impacting UI performance.

May return nothing.

Returns

msgAddOnPerformanceMessage

C_AddOnProfiler.GetAddOnMetric

result = C_AddOnProfiler.GetAddOnMetric(name, metric)

Gets an AddOn profiler value - all times returned are in milliseconds.

Arguments

namecstring
metricAddOnProfilerMetric

Returns

resultnumber

C_AddOnProfiler.GetApplicationMetric

result = C_AddOnProfiler.GetApplicationMetric(metric)

Overall profiling data for the entire application (not just the UI)

Arguments

metricAddOnProfilerMetric

Returns

resultnumber

C_AddOnProfiler.GetOverallMetric

result = C_AddOnProfiler.GetOverallMetric(metric)

Overall profiling data for all addons

Arguments

metricAddOnProfilerMetric

Returns

resultnumber

C_AddOnProfiler.GetTicksPerSecond

frequency = C_AddOnProfiler.GetTicksPerSecond()

Returns the number of profiling clock ticks that occur within a single real-time second.

Returns

frequencyBigInteger

C_AddOnProfiler.GetTopKAddOnsForMetric

results = C_AddOnProfiler.GetTopKAddOnsForMetric(metric, k)

Gets top K AddOns for a given metric.

Arguments

metricAddOnProfilerMetric
knumber

Returns

resultsAddOnProfilerResult[]

C_AddOnProfiler.IsEnabled

enabled = C_AddOnProfiler.IsEnabled()

AddOn profiler will be enabled for all users, but this will return false if it ever isn't

Returns

enabledbool

C_AddOnProfiler.MeasureCall

results, returns = C_AddOnProfiler.MeasureCall(func, arguments)

Performs a profiled measurement of a single function call with any supplied arguments.

Arguments

funcLuaValueVariant
argumentsLuaValueVariant

Returns

resultsAddOnProfilerCallResults
returnsLuaValueVariant

Tables

AddOnPerformanceMessage structure

typeAddOnPerformanceMessageType
metricAddOnProfilerMetric
addOnNamestring may be nil
metricValuenumber
thresholdValuenumber

AddOnProfilerCallEvent structure

namestringUser-defined string describing the measured event.
allocatedBytesBigUIntegerSnapshot of the allocated byte count when this event was recorded.
deallocatedBytesBigUIntegerSnapshot of the deallocated byte count when this event was recorded.
elapsedMillisecondsnumberSnapshot of the elapsed milliseconds when this event was recorded.
elapsedTicksBigIntegerSnapshot of the elapsed tick count when this event was recorded.

AddOnProfilerCallResults structure

elapsedMillisecondsnumberTotal number of milliseconds spent executing the function.
elapsedTicksBigIntegerTotal number of profiling clock ticks spent executing the function.
allocatedBytesBigUIntegerTotal number of bytes allocated during call execution.
deallocatedBytesBigUIntegerTotal number of bytes deallocated during call execution.
eventsAddOnProfilerCallEvent[]Events recorded by any AddMeasuredCallEvent calls that took place during function execution.

AddOnProfilerResult structure

addOnNamecstring
metricValuenumber

It takes WowAddons

Free, for Windows, macOS and Linux: it puts the addon in your game in one click and keeps it up to date. Open it once, then press Install again.

WowAddons runs on your computer: open wowaddons.gg there.

Download for Windows