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
name | stringView | User-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
msg | AddOnPerformanceMessage |
|---|
C_AddOnProfiler.CheckForPerformanceMessage
msg = C_AddOnProfiler.CheckForPerformanceMessage()
Optimized check for determining if AddOns are severely impacting UI performance.
May return nothing.
Returns
msg | AddOnPerformanceMessage |
|---|
C_AddOnProfiler.GetAddOnMetric
result = C_AddOnProfiler.GetAddOnMetric(name, metric)
Gets an AddOn profiler value - all times returned are in milliseconds.
Arguments
name | cstring | |
|---|---|---|
metric | AddOnProfilerMetric |
Returns
result | number |
|---|
C_AddOnProfiler.GetApplicationMetric
result = C_AddOnProfiler.GetApplicationMetric(metric)
Overall profiling data for the entire application (not just the UI)
Arguments
metric | AddOnProfilerMetric |
|---|
Returns
result | number |
|---|
C_AddOnProfiler.GetOverallMetric
result = C_AddOnProfiler.GetOverallMetric(metric)
Overall profiling data for all addons
Arguments
metric | AddOnProfilerMetric |
|---|
Returns
result | number |
|---|
C_AddOnProfiler.GetTicksPerSecond
frequency = C_AddOnProfiler.GetTicksPerSecond()
Returns the number of profiling clock ticks that occur within a single real-time second.
Returns
frequency | BigInteger |
|---|
C_AddOnProfiler.GetTopKAddOnsForMetric
results = C_AddOnProfiler.GetTopKAddOnsForMetric(metric, k)
Gets top K AddOns for a given metric.
Arguments
metric | AddOnProfilerMetric | |
|---|---|---|
k | number |
Returns
results | AddOnProfilerResult[] |
|---|
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
enabled | bool |
|---|
C_AddOnProfiler.MeasureCall
results, returns = C_AddOnProfiler.MeasureCall(func, arguments)
Performs a profiled measurement of a single function call with any supplied arguments.
Arguments
func | LuaValueVariant | |
|---|---|---|
arguments | LuaValueVariant |
Returns
results | AddOnProfilerCallResults | |
|---|---|---|
returns | LuaValueVariant |
Tables
AddOnPerformanceMessage structure
type | AddOnPerformanceMessageType | |
|---|---|---|
metric | AddOnProfilerMetric | |
addOnName | string may be nil | |
metricValue | number | |
thresholdValue | number |
AddOnProfilerCallEvent structure
name | string | User-defined string describing the measured event. |
|---|---|---|
allocatedBytes | BigUInteger | Snapshot of the allocated byte count when this event was recorded. |
deallocatedBytes | BigUInteger | Snapshot of the deallocated byte count when this event was recorded. |
elapsedMilliseconds | number | Snapshot of the elapsed milliseconds when this event was recorded. |
elapsedTicks | BigInteger | Snapshot of the elapsed tick count when this event was recorded. |
AddOnProfilerCallResults structure
elapsedMilliseconds | number | Total number of milliseconds spent executing the function. |
|---|---|---|
elapsedTicks | BigInteger | Total number of profiling clock ticks spent executing the function. |
allocatedBytes | BigUInteger | Total number of bytes allocated during call execution. |
deallocatedBytes | BigUInteger | Total number of bytes deallocated during call execution. |
events | AddOnProfilerCallEvent[] | Events recorded by any AddMeasuredCallEvent calls that took place during function execution. |
AddOnProfilerResult structure
addOnName | cstring | |
|---|---|---|
metricValue | number |