query · developer.performance

Performance log samples

Returns one bounded page of frame, CPU, and process-memory samples from the current or most recent log.

developer.performance.log-samples(filters?, cursor?, page_size?) -> query-page
Stable ID
developer.performance.log-samples
Owner
app.runtime-performance-monitor
Authority
read_only
Timing
immediate
Availability
active-session
Side effects
none
Determinism
stable owner order at the current committed tick
Introduced
1.0.0

Usage

Call through world.query to page through the active or most recent bounded logging session. Consume detached samples during the callback and use next_cursor for continuation.

Parameters

Returns

A detached page of frame index, instantaneous FPS, frame time, process CPU time and load, and resident-memory samples.

Cost

Copies at most 64 samples per call and consumes matching query-record and owner-visit budgets.

Fields

IDTypeUnitsRequiredDescription
cpu_msnumbermillisecondsyesProcess CPU time.
cpu_percentnumberpercent-of-one-coreyesProcess CPU time relative to wall time.
frameunsigned-integernoneyesRecorded frame index.
frame_msnumbermillisecondsyesFrame duration.
frames_per_secondnumberframes-per-secondyesInstantaneous frame rate.
memory_availablebooleannoneyesWhether resident memory was available.
resident_memory_bytesunsigned-integerbytesyesProcess resident memory.

Errors

Examples

local result = world.query("developer.performance.log-samples", {cursor = 0, page_size = 16})
for _, sample in ipairs(result.records) do
    ui.row("Frame " .. tostring(sample.frame), string.format("%.2f ms", sample.frame_ms))
end

API history

Related symbols

Project references