godotengine / godotengine/godot-docs

Performance Class example code has confusing comments

Open Beginner friendly
#11,603 0 comments 0 reactions 0 assignees View on GitHub
area:class reference bug
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**4.5.1:**

**Issue description:**
The documentation for the Performance class has example code for adding a custom monitor that refers to the newly added monitor as "MyName", but the code seems to be creating "MyMonitor" instead. This may confuse newer coders into thinking "MyName" is some other variable they didn't know about.

```
func _ready():
var monitor_value = Callable(self, "get_monitor_value")

# Adds monitor with name "MyName" to category "MyCategory".
Performance.add_custom_monitor("MyCategory/MyMonitor", monitor_value)

# Adds monitor with name "MyName" to category "Custom".
# Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different IDs, so the code is valid.
Performance.add_custom_monitor("MyMonitor", monitor_value)

# Adds monitor with name "MyName" to category "Custom".
# Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different IDs, so the code is valid.
Performance.add_custom_monitor("Custom/MyMonitor", monitor_value)

# Adds monitor with name "MyCategoryOne/MyCategoryTwo/MyMonitor" to category "Custom".
Performance.add_custom_monitor("MyCategoryOne/MyCategoryTwo/MyMonitor", monitor_value)

func get_monitor_value():
return randi() % 25
```

**https://docs.godotengine.org/en/stable/classes/class_performance.html#class-performance**

Contributor guide

No contributing guide indexed for this repository

Research direction

Open the Performance class documentation at the linked page and inspect the custom monitor example. Update the confusing comments so their monitor names match the code shown, then reread the example to confirm that no unexplained “MyName” references remain.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.