This repository was archived by the owner on Jan 24, 2026. It is now read-only.
Profiling framework#114
Open
rcahoon wants to merge 3 commits into
Open
Conversation
Member
Author
59f7537 to
23f6fdc
Compare
dejabot
reviewed
Oct 7, 2025
| if (!profilingEnabled.valueOr(false)) { | ||
| return null; | ||
| } | ||
| if (scopeIndex >= scopes.length) { |
dejabot
approved these changes
Oct 14, 2025
| if (!profilingEnabled.valueOr(false)) { | ||
| return null; | ||
| } | ||
| if (scopeIndex >= scopes.length) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Add a way to easily report runtime of different parts of the code to AdvantageScope.
The functionality is controlled by a config file flag, and should be very low-overhead when disabled. To enable it, set
"profiling": {"enabled": true}in the config file. It's recommended that you leaveSave to config file on robot?unchecked when doing this, so that profiling will revert to being disabled when the robot is restarted (i.e. before it gets put on the field for a match).A section of code can be profiled by wrapping it with
The whole robot main loop, Mechanism.run(), Procedures, RuleEngines, and Rules automatically get profiled.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Be detailed so that your code reviewer can understand exactly how much and what kinds of testing were done, and which might still be worthwhile to do.
Thread.sleep(50)in the mechanism'srun()method to produce some interesting data.