2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
<class name= "Performance" inherits= "Object" category= "Core" version= "3.0.alpha.custom_build" >
<brief_description >
2017-10-08 16:31:56 +00:00
Exposes performance related data.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2017-10-08 16:31:56 +00:00
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 [i]Monitor[/i] tab in the editor's [i]Debugger[/i] panel. By using the [method get_monitor] method of this class, you can access this data from your code. Note that a few of these monitors are only available in debug mode and will always return 0 when used in a release build.
Many of these monitors are not updated in real-time, so there may be a short delay between changes.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
</tutorials>
<demos >
</demos>
<methods >
<method name= "get_monitor" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "monitor" type= "int" enum= "Performance.Monitor" >
</argument>
<description >
2017-10-08 16:31:56 +00:00
Returns the value of one of the available monitors. You should provide one of this class's constants as the argument, like this:
[codeblock]
print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console
[/codeblock]
2017-09-12 20:42:36 +00:00
</description>
</method>
</methods>
<constants >
<constant name= "TIME_FPS" value= "0" >
2017-10-08 16:31:56 +00:00
Frames per second.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "TIME_PROCESS" value= "1" >
2017-10-08 16:31:56 +00:00
Time it took to complete one frame.
2017-09-12 20:42:36 +00:00
</constant>
2017-10-08 16:31:56 +00:00
<constant name= "TIME_PHYSICS_PROCESS" value= "2" >
Time it took to complete one physics frame.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "MEMORY_STATIC" value= "3" >
2017-10-08 16:31:56 +00:00
Static memory currently used, in bytes. Not available in release builds.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "MEMORY_DYNAMIC" value= "4" >
2017-10-08 16:31:56 +00:00
Dynamic memory currently used, in bytes. Not available in release builds.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "MEMORY_STATIC_MAX" value= "5" >
2017-10-08 16:31:56 +00:00
Available static memory. Not available in release builds.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "MEMORY_DYNAMIC_MAX" value= "6" >
2017-10-08 16:31:56 +00:00
Available dynamic memory. Not available in release builds.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "MEMORY_MESSAGE_BUFFER_MAX" value= "7" >
2017-10-08 16:31:56 +00:00
Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "OBJECT_COUNT" value= "8" >
2017-10-08 16:31:56 +00:00
Number of objects currently instanced (including nodes).
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "OBJECT_RESOURCE_COUNT" value= "9" >
2017-10-08 16:31:56 +00:00
Number of resources currently used.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "OBJECT_NODE_COUNT" value= "10" >
2017-10-08 16:31:56 +00:00
Number of nodes currently instanced. This also includes the root node, as well as any nodes not in the scene tree.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "RENDER_OBJECTS_IN_FRAME" value= "11" >
2017-10-08 16:31:56 +00:00
3D objects drawn per frame.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "RENDER_VERTICES_IN_FRAME" value= "12" >
2017-10-08 16:31:56 +00:00
Vertices drawn per frame. 3D only.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "RENDER_MATERIAL_CHANGES_IN_FRAME" value= "13" >
2017-10-08 16:31:56 +00:00
Material changes per frame. 3D only
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "RENDER_SHADER_CHANGES_IN_FRAME" value= "14" >
2017-10-08 16:31:56 +00:00
Shader changes per frame. 3D only.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "RENDER_SURFACE_CHANGES_IN_FRAME" value= "15" >
2017-10-08 16:31:56 +00:00
Render surface changes per frame. 3D only.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "RENDER_DRAW_CALLS_IN_FRAME" value= "16" >
2017-10-08 16:31:56 +00:00
Draw calls per frame. 3D only.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "RENDER_VIDEO_MEM_USED" value= "17" >
2017-10-08 16:31:56 +00:00
Video memory used. Includes both texture and vertex memory.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "RENDER_TEXTURE_MEM_USED" value= "18" >
2017-10-08 16:31:56 +00:00
Texture memory used.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "RENDER_VERTEX_MEM_USED" value= "19" >
2017-10-08 16:31:56 +00:00
Vertex memory used.
</constant>
2017-10-22 10:56:11 +00:00
<constant name= "RENDER_USAGE_VIDEO_MEM_TOTAL" value= "20" >
</constant>
2017-09-12 20:42:36 +00:00
<constant name= "PHYSICS_2D_ACTIVE_OBJECTS" value= "21" >
2017-10-08 16:31:56 +00:00
Number of active [RigidBody2D] nodes in the game.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "PHYSICS_2D_COLLISION_PAIRS" value= "22" >
2017-10-08 16:31:56 +00:00
Number of collision pairs in the 2D physics engine.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "PHYSICS_2D_ISLAND_COUNT" value= "23" >
2017-10-08 16:31:56 +00:00
Number of islands in the 2D physics engine.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "PHYSICS_3D_ACTIVE_OBJECTS" value= "24" >
2017-10-08 16:31:56 +00:00
Number of active [RigidBody] and [VehicleBody] nodes in the game.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "PHYSICS_3D_COLLISION_PAIRS" value= "25" >
2017-10-08 16:31:56 +00:00
Number of collision pairs in the 3D physics engine.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "PHYSICS_3D_ISLAND_COUNT" value= "26" >
2017-10-08 16:31:56 +00:00
Number of islands in the 3D physics engine.
2017-09-12 20:42:36 +00:00
</constant>
<constant name= "MONITOR_MAX" value= "27" >
</constant>
</constants>
</class>