Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

Performance

Inherits: Object

Exposes performance-related data.

Description

This class provides access to a number of different monitors related to performance, such as memory usage, draw calls, and FPS. These are the same as the values displayed in the Monitor tab in the editor's Debugger panel. By using the get_monitor method of this class, you can access this data from your code.

You can add custom monitors using the add_custom_monitor method. Custom monitors are available in Monitor tab in the editor's Debugger panel together with built-in monitors.

Note: Some of the built-in monitors are only available in debug mode and will always return 0 when used in a project exported in release mode.

Note: Some of the built-in monitors are not updated in real-time for performance reasons, so there may be a delay of up to 1 second between changes.

Note: Custom monitors do not support negative values. Negative values are clamped to 0.

Methods

void

add_custom_monitor ( StringName id, Callable callable, Array arguments=[] )

Variant

get_custom_monitor ( StringName id )

StringName[]

get_custom_monitor_names ( )

float

get_monitor ( Monitor monitor ) const

int

get_monitor_modification_time ( )

bool

has_custom_monitor ( StringName id )

void

remove_custom_monitor ( StringName id )


Enumerations

enum Monitor:

Monitor TIME_FPS = 0

The number of frames rendered in the last second. This metric is only updated once per second, even if queried more often. Higher is better.

Monitor TIME_PROCESS = 1

Time it took to complete one frame, in seconds. Lower is better.

Monitor TIME_PHYSICS_PROCESS = 2

Time it took to complete one physics frame, in seconds. Lower is better.

Monitor TIME_NAVIGATION_PROCESS = 3

Time it took to complete one navigation step, in seconds. This includes navigation map updates as well as agent avoidance calculations. Lower is better.

Monitor MEMORY_STATIC = 4

Static memory currently used, in bytes. Not available in release builds. Lower is better.

Monitor MEMORY_STATIC_MAX = 5

Available static memory. Not available in release builds. Lower is better.

Monitor MEMORY_MESSAGE_BUFFER_MAX = 6

Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications. Lower is better.

Monitor OBJECT_COUNT = 7

Number of objects currently instantiated (including nodes). Lower is better.

Monitor OBJECT_RESOURCE_COUNT = 8

Number of resources currently used. Lower is better.

Monitor OBJECT_NODE_COUNT = 9

Number of nodes currently instantiated in the scene tree. This also includes the root node. Lower is better.

Monitor OBJECT_ORPHAN_NODE_COUNT = 10

Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree. Lower is better.

Monitor RENDER_TOTAL_OBJECTS_IN_FRAME = 11

The total number of objects in the last rendered frame. This metric doesn't include culled objects (either via hiding nodes, frustum culling or occlusion culling). Lower is better.

Monitor RENDER_TOTAL_PRIMITIVES_IN_FRAME = 12

The total number of vertices or indices rendered in the last rendered frame. This metric doesn't include primitives from culled objects (either via hiding nodes, frustum culling or occlusion culling). Due to the depth prepass and shadow passes, the number of primitives is always higher than the actual number of vertices in the scene (typically double or triple the original vertex count). Lower is better.

Monitor RENDER_TOTAL_DRAW_CALLS_IN_FRAME = 13

The total number of draw calls performed in the last rendered frame. This metric doesn't include culled objects (either via hiding nodes, frustum culling or occlusion culling), since they do not result in draw calls. Lower is better.

Monitor RENDER_VIDEO_MEM_USED = 14

The amount of video memory used (texture and vertex memory combined, in bytes). Since this metric also includes miscellaneous allocations, this value is always greater than the sum of RENDER_TEXTURE_MEM_USED and RENDER_BUFFER_MEM_USED. Lower is better.

Monitor RENDER_TEXTURE_MEM_USED = 15

The amount of texture memory used (in bytes). Lower is better.

Monitor RENDER_BUFFER_MEM_USED = 16

The amount of render buffer memory used (in bytes). Lower is better.

Monitor PHYSICS_2D_ACTIVE_OBJECTS = 17

Number of active