glutton: add RunScript, a script tree run inside the actor as one request - #2162
Open
Max Smythe (maxsmythe) wants to merge 1 commit into
Open
Max Smythe (maxsmythe) wants to merge 1 commit into
Max Smythe (maxsmythe) wants to merge 1 commit into
Conversation
…uest A benchmark that wants an actor to do a whole on-sandbox activity, a build, a test run, a file churn, had to issue every resource operation as its own request through the router. That costs a round trip per operation, and it leaves the driver unable to hold the actor busy for a chosen length of time without knowing how long each operation takes on the sandbox at hand. RunScript takes the activity as a script and runs it in-process, holding the request open until it finishes. A script is a tree. A Block runs its steps in order and may cycle them for a wall-clock budget; a Step is a nested Block or an Operation; an Operation runs its requests at the same time and waits for all of them. A budget is checked between passes: the pass under way finishes, so a loop overruns by at most one pass and no request is cut short, and a nested block stops cycling once any ancestor's budget has elapsed the same way. The only errors are the caller's context ending and a failing request, which names the request's path in the tree and keeps its status code. The request set is the service's work requests plus sleep. UseCPU and OpenFD are left out because they install a background load that outlives the script; BurnCPU is the CPU spike. The response mirrors the tree with summed vital stats at every node: requests run, bytes written and read to disk and RAM, burn iterations, time slept, and the node's own wall clock and entry count. A node inside a looped block sums over its passes, so the response is the size of the script however long it ran, and the root carries the totals. The fake actor answers a script with the mirrored tree, so drivers can be tested against it.
Max Smythe (maxsmythe)
requested a review
from Aditya Shantanu (aditya-shantanu)
October 3, 2026 20:41
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A benchmark that wants an actor to do a whole on-sandbox activity, a build, a test run, a file churn, had to issue every resource operation as its own request through the router. That costs a round trip per operation, and it leaves the driver unable to hold the actor busy for a chosen length of time without knowing how long each operation takes on the sandbox at hand.
RunScript takes the activity as a script and runs it in-process, holding the request open until it finishes. A script is a tree. A Block runs its steps in order and may cycle them for a wall-clock budget; a Step is a nested Block or an Operation; an Operation runs its requests at the same time and waits for all of them. A budget is checked between passes: the pass under way finishes, so a loop overruns by at most one pass and no request is cut short, and a nested block stops cycling once any ancestor's budget has elapsed the same way. The only errors are the caller's context ending and a failing request, which names the request's path in the tree and keeps its status code. The request set is the service's work requests plus sleep. UseCPU and OpenFD are left out because they install a background load that outlives the script; BurnCPU is the CPU spike.
The response mirrors the tree with summed vital stats at every node: requests run, bytes written and read to disk and RAM, burn iterations, time slept, and the node's own wall clock and entry count. A node inside a looped block sums over its passes, so the response is the size of the script however long it ran, and the root carries the totals. The fake actor answers a script with the mirrored tree, so drivers can be tested against it.
Fixes #<issue_number_goes_here>