| | | 1 | | using System.ComponentModel; |
| | | 2 | | using Spectre.Console; |
| | | 3 | | using Spectre.Console.Cli; |
| | | 4 | | |
| | | 5 | | namespace Orchestrator.Commands.Observability.Experiments; |
| | | 6 | | |
| | | 7 | | public sealed class RunRepeatedMatchSliceSettings : RunExperimentSettingsBase |
| | | 8 | | { |
| | | 9 | | [CommandOption("--batch-count")] |
| | | 10 | | [Description("Optional number of post-warmup batches per fixture. Defaults to 3")] |
| | | 11 | | [DefaultValue(3)] |
| | 1 | 12 | | public int BatchCount { get; set; } = 3; |
| | | 13 | | |
| | | 14 | | [CommandOption("--parallelism")] |
| | | 15 | | [Description("Maximum number of repeated-match fixture workflows to run concurrently. Defaults to 5")] |
| | | 16 | | [DefaultValue(5)] |
| | 1 | 17 | | public int Parallelism { get; set; } = 5; |
| | | 18 | | |
| | | 19 | | public override ValidationResult Validate() |
| | | 20 | | { |
| | 1 | 21 | | var commonValidation = ValidateCommon(); |
| | 1 | 22 | | if (!commonValidation.Successful) |
| | | 23 | | { |
| | 0 | 24 | | return commonValidation; |
| | | 25 | | } |
| | | 26 | | |
| | 1 | 27 | | if (BatchCount < 1) |
| | | 28 | | { |
| | 0 | 29 | | return ValidationResult.Error("--batch-count must be at least 1"); |
| | | 30 | | } |
| | | 31 | | |
| | 1 | 32 | | if (Parallelism < 1) |
| | | 33 | | { |
| | 1 | 34 | | return ValidationResult.Error("--parallelism must be at least 1"); |
| | | 35 | | } |
| | | 36 | | |
| | 1 | 37 | | return ValidationResult.Success(); |
| | | 38 | | } |
| | | 39 | | |
| | | 40 | | internal PreparedExperimentRunOptions ToRunOptions() |
| | | 41 | | { |
| | 1 | 42 | | return CreateRunOptions( |
| | 1 | 43 | | "warmup-plus-batches", |
| | 1 | 44 | | batchCount: BatchCount, |
| | 1 | 45 | | parallelism: Parallelism); |
| | | 46 | | } |
| | | 47 | | } |