Is there a way to access the debugging monitor values from GDScript?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Saitodepaula

I would like to access the Debugging Monitor Values like Vertices Drawn and Draw Calls, from GDScript. This way, it’s possible to print them in labels, so that I can see the values on the game screen.

This is useful so that there is no need to switch from game screen to editor screen, or, if the game is in fullscreen mode.

The only value from the monitor I know is available is FPS, from the GetFramesPerSecond function.

:bust_in_silhouette: Reply From: Saitodepaula

Found out:

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 that a few of these monitors are only available in debug mode and will always return 0 when used in a release build.