Exposes performance-related data.
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.
Note: A few of these monitors are only available in debug mode and will always return 0 when used in a release build.
Note: Many of these monitors are not updated in real-time, so there may be a short delay between changes.
TIME_FPS = 0 --- Number of frames per second.
TIME_PROCESS = 1 --- Time it took to complete one frame, in seconds.
TIME_PHYSICS_PROCESS = 2 --- Time it took to complete one physics frame, in seconds.
MEMORY_STATIC = 3 --- Static memory currently used, in bytes. Not available in release builds.
MEMORY_STATIC_MAX = 4 --- Available static memory. Not available in release builds.
MEMORY_MESSAGE_BUFFER_MAX = 5 --- Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications.
OBJECT_COUNT = 6 --- Number of objects currently instanced (including nodes).
OBJECT_RESOURCE_COUNT = 7 --- Number of resources currently used.
OBJECT_NODE_COUNT = 8 --- Number of nodes currently instanced in the scene tree. This also includes the root node.
OBJECT_ORPHAN_NODE_COUNT = 9 --- Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree.
RENDER_OBJECTS_IN_FRAME = 10 --- 3D objects drawn per frame.
RENDER_VERTICES_IN_FRAME = 11 --- Vertices drawn per frame. 3D only.
RENDER_MATERIAL_CHANGES_IN_FRAME = 12 --- Material changes per frame. 3D only.
RENDER_SHADER_CHANGES_IN_FRAME = 13 --- Shader changes per frame. 3D only.
RENDER_SURFACE_CHANGES_IN_FRAME = 14 --- Render surface changes per frame. 3D only.
RENDER_DRAW_CALLS_IN_FRAME = 15 --- Draw calls per frame. 3D only.
RENDER_VIDEO_MEM_USED = 16 --- The amount of video memory used, i.e. texture and vertex memory combined.
RENDER_TEXTURE_MEM_USED = 17 --- The amount of texture memory used.
RENDER_VERTEX_MEM_USED = 18 --- The amount of vertex memory used.
RENDER_USAGE_VIDEO_MEM_TOTAL = 19 --- Unimplemented in the GLES2 rendering backend, always returns 0.
PHYSICS_2D_ACTIVE_OBJECTS = 20 --- Number of active RigidBody2D nodes in the game.
PHYSICS_2D_COLLISION_PAIRS = 21 --- Number of collision pairs in the 2D physics engine.
PHYSICS_2D_ISLAND_COUNT = 22 --- Number of islands in the 2D physics engine.
PHYSICS_3D_COLLISION_PAIRS = 24 --- Number of collision pairs in the 3D physics engine.
PHYSICS_3D_ISLAND_COUNT = 25 --- Number of islands in the 3D physics engine.
AUDIO_OUTPUT_LATENCY = 26 --- Output latency of the AudioServer.
MONITOR_MAX = 27 --- Represents the size of the Monitor enum.