Performance monitor

An asset by baz_a
The page banner background of a mountain and forest
Performance monitor hero image

Quick Information

0 ratings
Performance monitor icon image
baz_a
Performance monitor

In-game monitoring node with plots for performance or anything else.Just add a Monitor node to your scene and setup any number of plots with one function call each, like $Monitor.add_perf_monitor(Performance.TIME_FPS, "FPS")

Supported Engine Version
3.2
Version String
0.1.1
License Version
MIT
Support Level
community
Modified Date
4 years ago
Git URL
Issue URL

Performance monitor node for Godot

Simple node for in-game monitoring of FPS, memory usage and such, loosely styled by Three.js's performance monitor.

README Example

It may have some performance overhead (around 180 draw calls per frame, CPU and mem usage is slight), but for FPS or memory monitoring it seems insignificant.

Can display any numeric object parameter or function call result.

Usage

  • Install from AssetLib

  • Add Monitor node to your scene tree

  • Setup what to monitor

    •   $Monitor.os_time_per_frame()
      
    •   $Monitor.add_perf_monitor(Performance.TIME_FPS, "FPS")
      
    •   $Monitor.add_custom_monitor($Player, "hitpoints", "Player hp")
        # your $Player node must have "hitpoints" attribute, which must be either float or int
      
    •   var render_info_funcref: FuncRef = funcref(VisualServer, "get_render_info")
        $Monitor.add_funcref_monitor(render_info_funcref, [VisualServer.INFO_TEXTURE_MEM_USED], "Texture mem")
      

Also you can set plot size, color, or amount of plot stored data, check out example.gd.

Convenience function $Monitor.os_time_per_frame(), creates a monitor to show difference in OS.get_ticks_usec() between _process() calls.

Reference

  •   os_time_perframe() - creates a plot panel to show difference between OS.get_ticks_usec() calls
    
  •   add_perf_monitor() - creates a plot panel to monitor one of the built-in Performance enum 
    
      # required
      param_key: int - key from Performance enum 
      
      # optional	
      label: String = "" - label to display
      color: Color = Color(0.2, 1, 0.2, 0.5) - color
      humanise: bool = false - whether to use humanize for large numbers
      is_data_int: bool = true - !important for floats change to false
      max_value: float = 0.0 - maximum value
      data_len: int = 180 
      size_px: Vector2 = Vector2(180, 80)
    
  •   add_custom_monitor() - creates a plot panel to monitor one of the passed objects' numeric attributes
    
      # required
      obj: Object - object to monitor
      param_name: String - name of numeric attribute of the object above
      
      # optional	
      label: String = "" - label to display
      color: Color = Color(0.2, 1, 0.2, 0.5) - color
      humanise: bool = false - whether to use humanize for large numbers
      is_data_int: bool = true - !important for floats change to false
      max_value: float = 0.0 - maximum value
      data_len: int = 180 
      size_px: Vector2 = Vector2(180, 80)
    
  •   add_funcref_monitor() - creates a plot panel to monitor results of the calls to the passed function
    
      # required
      function_ref: FuncRef - funcref to a function that will be called every _process()
      
      # optional	
      function_params: Array = [] - array of function param values
      label: String = "" - label to display
      color: Color = Color(0.2, 1, 0.2, 0.5) - color
      humanise: bool = false - whether to use humanize for large numbers
      is_data_int: bool = true - !important for floats change to false
      max_value: float = 0.0 - maximum value
      data_len: int = 180 
      size_px: Vector2 = Vector2(180, 80)
    

Other notes

The draw call happens in _process(), so update rate may be not constant.

The plot uses some kind of ring buffer based on PoolIntArray or PoolRealArray for storing data.

Rendering may be optimized.

In-game monitoring node with plots for performance or anything else.

Just add a Monitor node to your scene and setup any number of plots with one function call each, like
$Monitor.add_perf_monitor(Performance.TIME_FPS, "FPS")

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Performance monitor icon image
baz_a
Performance monitor

In-game monitoring node with plots for performance or anything else.Just add a Monitor node to your scene and setup any number of plots with one function call each, like $Monitor.add_perf_monitor(Performance.TIME_FPS, "FPS")

Supported Engine Version
3.2
Version String
0.1.1
License Version
MIT
Support Level
community
Modified Date
4 years ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers