Skip to content

Conversation

@JasonXuDeveloper
Copy link
Contributor

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.

@xinWeiWei24 xinWeiWei24 self-requested a review December 17, 2025 00:10
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>
@fuweid fuweid merged commit ef368af into Azure:main Jan 22, 2026
4 checks passed
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants