2022-03-15 13:29:32 +01:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-06-13 16:51:37 +02:00
<class name= "Performance" inherits= "Object" version= "3.12" >
2022-03-15 13:29:32 +01:00
<brief_description >
Exposes performance-related data.
</brief_description>
<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 [b]Monitor[/b] tab in the editor's [b]Debugger[/b] panel. By using the [method get_monitor] method of this class, you can access this data from your code.
[b]Note:[/b] A few of these monitors are only available in debug mode and will always return 0 when used in a release build.
[b]Note:[/b] Many of these monitors are not updated in real-time, so there may be a short delay between changes.
</description>
<tutorials >
</tutorials>
<methods >
<method name= "get_monitor" qualifiers= "const" >
<return type= "float" />
<argument index= "0" name= "monitor" type= "int" enum= "Performance.Monitor" />
<description >
Returns the value of one of the available monitors. You should provide one of the [enum Monitor] constants as the argument, like this:
[codeblock]
print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console
[/codeblock]
</description>
</method>
</methods>
<constants >
<constant name= "TIME_FPS" value= "0" enum= "Monitor" >
Number of frames per second.
</constant>
<constant name= "TIME_PROCESS" value= "1" enum= "Monitor" >
Time it took to complete one frame, in seconds.
</constant>
<constant name= "TIME_PHYSICS_PROCESS" value= "2" enum= "Monitor" >
Time it took to complete one physics frame, in seconds.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "TIME_NAVIGATION_PROCESS" value= "3" enum= "Monitor" >
Time it took to complete one navigation step, in seconds. This includes navigation map updates as well as agent avoidance calculations. [i]Lower is better.[/i]
</constant>
<constant name= "MEMORY_STATIC" value= "4" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Static memory currently used, in bytes. Not available in release builds.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "MEMORY_DYNAMIC" value= "5" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Dynamic memory currently used, in bytes. Not available in release builds.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "MEMORY_STATIC_MAX" value= "6" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Available static memory. Not available in release builds.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "MEMORY_DYNAMIC_MAX" value= "7" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Available dynamic memory. Not available in release builds.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "MEMORY_MESSAGE_BUFFER_MAX" value= "8" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "OBJECT_COUNT" value= "9" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Number of objects currently instanced (including nodes).
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "OBJECT_RESOURCE_COUNT" value= "10" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Number of resources currently used.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "OBJECT_NODE_COUNT" value= "11" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Number of nodes currently instanced in the scene tree. This also includes the root node.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "OBJECT_ORPHAN_NODE_COUNT" value= "12" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "RENDER_OBJECTS_IN_FRAME" value= "13" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
3D objects drawn per frame.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "RENDER_VERTICES_IN_FRAME" value= "14" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Vertices drawn per frame. 3D only.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "RENDER_MATERIAL_CHANGES_IN_FRAME" value= "15" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Material changes per frame. 3D only.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "RENDER_SHADER_CHANGES_IN_FRAME" value= "16" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Shader changes per frame. 3D only.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "RENDER_SURFACE_CHANGES_IN_FRAME" value= "17" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Render surface changes per frame. 3D only.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "RENDER_DRAW_CALLS_IN_FRAME" value= "18" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Draw calls per frame. 3D only.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "RENDER_2D_ITEMS_IN_FRAME" value= "19" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Items or joined items drawn per frame.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "RENDER_2D_DRAW_CALLS_IN_FRAME" value= "20" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Draw calls per frame.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "RENDER_VIDEO_MEM_USED" value= "21" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
The amount of video memory used, i.e. texture and vertex memory combined.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "RENDER_TEXTURE_MEM_USED" value= "22" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
The amount of texture memory used.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "RENDER_VERTEX_MEM_USED" value= "23" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
The amount of vertex memory used.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "RENDER_USAGE_VIDEO_MEM_TOTAL" value= "24" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "PHYSICS_2D_ACTIVE_OBJECTS" value= "25" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Number of active [RigidBody2D] nodes in the game.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "PHYSICS_2D_COLLISION_PAIRS" value= "26" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Number of collision pairs in the 2D physics engine.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "PHYSICS_2D_ISLAND_COUNT" value= "27" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Number of islands in the 2D physics engine.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "PHYSICS_3D_ACTIVE_OBJECTS" value= "28" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Number of active [RigidBody] and [VehicleBody] nodes in the game.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "PHYSICS_3D_COLLISION_PAIRS" value= "29" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Number of collision pairs in the 3D physics engine.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "PHYSICS_3D_ISLAND_COUNT" value= "30" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Number of islands in the 3D physics engine.
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "AUDIO_OUTPUT_LATENCY" value= "31" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Output latency of the [AudioServer].
</constant>
2023-06-09 10:17:43 +02:00
<constant name= "NAVIGATION_ACTIVE_MAPS" value= "32" enum= "Monitor" >
Number of active navigation maps in the [NavigationServer3D]. This also includes the two empty default navigation maps created by World2D and World3D.
</constant>
<constant name= "NAVIGATION_REGION_COUNT" value= "33" enum= "Monitor" >
Number of active navigation regions in the [NavigationServer3D].
</constant>
<constant name= "NAVIGATION_AGENT_COUNT" value= "34" enum= "Monitor" >
Number of active navigation agents processing avoidance in the [NavigationServer3D].
</constant>
<constant name= "NAVIGATION_LINK_COUNT" value= "35" enum= "Monitor" >
Number of active navigation links in the [NavigationServer3D].
</constant>
<constant name= "NAVIGATION_POLYGON_COUNT" value= "36" enum= "Monitor" >
Number of navigation mesh polygons in the [NavigationServer3D].
</constant>
<constant name= "NAVIGATION_EDGE_COUNT" value= "37" enum= "Monitor" >
Number of navigation mesh polygon edges in the [NavigationServer3D].
</constant>
<constant name= "NAVIGATION_EDGE_MERGE_COUNT" value= "38" enum= "Monitor" >
Number of navigation mesh polygon edges that were merged due to edge key overlap in the [NavigationServer3D].
</constant>
<constant name= "NAVIGATION_EDGE_CONNECTION_COUNT" value= "39" enum= "Monitor" >
Number of polygon edges that are considered connected by edge proximity [NavigationServer3D].
</constant>
<constant name= "NAVIGATION_EDGE_FREE_COUNT" value= "40" enum= "Monitor" >
Number of navigation mesh polygon edges that could not be merged in the [NavigationServer3D]. The edges still may be connected by edge proximity or with links.
</constant>
<constant name= "MONITOR_MAX" value= "41" enum= "Monitor" >
2022-03-15 13:29:32 +01:00
Represents the size of the [enum Monitor] enum.
</constant>
</constants>
</class>