-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add backward-compatible Specs field to LoadProfile #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
xinWeiWei24
reviewed
Dec 17, 2025
xinWeiWei24
reviewed
Dec 17, 2025
9ff6b04 to
5424357
Compare
fuweid
reviewed
Dec 18, 2025
fuweid
reviewed
Jan 22, 2026
Add Specs []LoadProfileSpec field alongside existing Spec field to enable time-series replay support in future. Update all code to use GetSpecs() accessor method for unified access to both old and new formats. Changes: - Add Specs field with omitempty tags to LoadProfile struct - Add GetSpecs() method to handle both single Spec and Specs formats - Update LoadProfile.Validate() to validate all specs - Update runner, runkperf bench, and warmup commands to use GetSpecs() - Maintain backward compatibility with existing configs All existing configs with 'spec:' continue to work unchanged. New configs can use 'specs:' array format. No functional changes in this commit. Signed-off-by: JasonXuDeveloper <jason@xgamedev.net>
Convert single Spec field to Specs array for time-series replay support. This is a breaking change that removes backward compatibility as the feature is not yet GA. Changes: - Update LoadProfile struct to use Specs []LoadProfileSpec - Remove backward compatibility code (GetSpecs/SetFirstSpec methods) - Update all code references to use .Specs[0] direct access - Convert all YAML configs from spec: to specs: list format - Update tests to match new structure All builds pass and tests verified. Signed-off-by: JasonXuDeveloper <jason@xgamedev.net>
Address code review feedback by extracting profileCfg.Specs[0] into a local pspec variable and adding validation to ensure runner only supports single spec configurations. Changes: - Add check to return error if len(profileCfg.Specs) > 1 - Extract profileCfg.Specs[0] into pspec variable for cleaner code - Replace all profileCfg.Specs[0] references with pspec This improves code readability and explicitly validates the single-spec constraint for the runner command. Signed-off-by: JasonXuDeveloper <jason@xgamedev.net>
72b1953 to
9cdc909
Compare
fuweid
approved these changes
Jan 22, 2026
fuweid
pushed a commit
that referenced
this pull request
Jan 23, 2026
… replay (#229) ## Summary Add support for executing multiple specs sequentially within a single kperf runner invocation, enabling time-series replay scenarios where workload patterns vary over time. ## Changes ### Core Multi-Spec Functionality - Add `MultiSpecRunnerMetricReport` type for multi-spec results in `api/types/metric.go` - Implement `executeSpecs()` for sequential spec execution - Implement `aggregateResults()` to combine per-spec results into aggregated metrics - Add `printMultiSpecResults()` for multi-spec output format - Add `hasCliOverrides()` to detect and prevent CLI overrides with multi-spec configs - Update `buildRunnerGroupSummary()` in `runner/utils.go` to handle both single and multi-spec report formats ### Example and Demo - Add timeseries replay example config with 3 phases: - Baseline: 10 QPS for 30s - Spike: 100 QPS for 20s - Recovery: 25 QPS for 30s - Add `benchTimeseriesReplayCase` command to demonstrate time-series replay ### Technical Details - Multi-spec configs with CLI flag overrides are rejected with clear error message - Single-spec configs continue to work without changes - All specs share the same HTTP client pool (configured from first spec) - Results are aggregated with per-spec breakdown and overall summary ## Use Cases This enables realistic workload patterns useful for: - Stress testing with gradual load increases - Capacity planning with varying traffic patterns - Validating system behavior during load spikes and recovery - Time-series replay of production traffic patterns ## Testing - ✅ Built and tested locally - ✅ All existing single-spec configs work unchanged - ✅ Multi-spec timeseries replay example validated - ✅ Proper aggregation of results across multiple specs ## Related This PR builds on #226 which converted the `Spec` field to `Specs` array format. --------- Signed-off-by: JasonXuDeveloper <jason@xgamedev.net>
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.
Add Specs []LoadProfileSpec field alongside existing Spec field to enable time-series replay support in future. Update all code to use GetSpecs() accessor method for unified access to both old and new formats.
Changes:
All existing configs with 'spec:' continue to work unchanged. New configs can use 'specs:' array format. No functional changes in this commit.