Performance Class example code has confusing comments
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 85/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- documentation
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.
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
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 7d 14h
- Merged PRs (30d)
- 41
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from godotengine/godot-docs
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
godotengine/godot-docs#12394 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
godotengine/godot-docs#12366 · 1 comment ·
-
area:class reference area:manual enhancement topic:2d topic:physics
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
godotengine/godot-docs#12364 · 3 comments ·
-
bug content:website
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
godotengine/godot-docs#12360 · 1 comment ·
-
bug content:website
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
godotengine/godot-docs#12348 ·
All issues in godotengine/godot-docs
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Ecosystem: ClawMetry — the Qwen Code reader is now free and open source (follow-up to #9294 / #9338) Opencategory/integration priority/P3 scope/documentation status/ready-for-human type/feature-request
Difficulty 1/5 Under an hour Newbie friendliness 84/100