benchmarking(boomer): disentangle dynConfig - #2160
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
…e config dynconfig had become one struct of every knob every user class ever needed, with a payload mirror, a merge, a validator, and a log line that all had to grow by hand for each new field, and every class saw and was checked against every other class's knobs. The payload is now an arbitrary JSON object, and a worker runs exactly one user class, known at launch. So each class declares the keys it reads as a struct with json tags, wraps it in a dynconfig.Typed codec with its defaults and its validation func, and registers the codec with its userclass.Entry. The worker builds the holder from that codec; the holder stores the typed value, folds each payload into it with one decode over the current value (so an absent or null key keeps what it had), refuses a payload the class cannot run on in favor of the last good config, and hands the class its knobs back through dynconfig.Get. Keys the class does not name are ignored. The wait window and the resume and lifecycle modes are shared pieces a class embeds; durations travel as seconds, the unit the locust flags use. The GluttonUser defaults the worker used to seed from main.go (a 500ms max wait, one ping per wake) live in that class's codec now, and the durdir read modes move into the glutton package with the class that reads them.
Max Smythe (maxsmythe)
requested a review
from Aditya Shantanu (aditya-shantanu)
October 3, 2026 18:59
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.
dynconfig had become one struct of every knob every user class ever needed, with a payload mirror, a merge, a validator, and a log line that all need to grow by hand for each new field, and every class saw and was checked against every other class's knobs.
The payload is now an arbitrary JSON object, and a worker runs exactly one user class, known at launch. So each class declares the keys it reads as a struct with json tags, wraps it in a dynconfig.Typed codec with its defaults and its validation func, and registers the codec with its userclass.Entry. The worker builds the holder from that codec; the holder stores the typed value, folds each payload into it with one decode over the current value (so an absent or null key keeps what it had), refuses a payload the class cannot run on in favor of the last good config, and hands the class its knobs back through dynconfig.Get. Keys the class does not name are ignored. The wait window and the resume and lifecycle modes are shared pieces a class embeds; durations travel as seconds, the unit the locust flags use.
Now we can implement user classes more independently of each other.