2525 count int
2626
2727 // Track command flags.
28- baselineTag string
29- currentTag string
28+ Baseline string
29+ Current string
3030 benchmarkName string
3131 profileType string
3232 outputFormat string
@@ -117,13 +117,13 @@ func createTrackCmd() *cobra.Command {
117117
118118func createTrackAutoCmd () * cobra.Command {
119119 baseTagFlag := "base"
120- currentTagFlag := "current"
120+ currentFlag := "current"
121121 benchNameFlag := "bench-name"
122122 profileTypeFlag := "profile-type"
123123 outputFormatFlag := "output-format"
124124 failFlag := "fail-on-regression"
125125 thresholdFlag := "regression-threshold"
126- example := fmt .Sprintf (`prof track auto --%s "tag1" --%s "tag2" --%s "cpu" --%s "BenchmarkGenPool" --%s "summary"` , baseTagFlag , currentTagFlag , profileTypeFlag , benchNameFlag , outputFormatFlag )
126+ example := fmt .Sprintf (`prof track auto --%s "tag1" --%s "tag2" --%s "cpu" --%s "BenchmarkGenPool" --%s "summary"` , baseTagFlag , currentFlag , profileTypeFlag , benchNameFlag , outputFormatFlag )
127127 longExplanation := fmt .Sprintf ("This command only works if the %s command was used to collect and organize the benchmark and profile data, as it expects a specific directory structure generated by that process." , internal .AUTOCMD )
128128 shortExplanation := "If prof auto was used to collect the data, track auto can be used to analyze it, you just have to pass the tag name."
129129
@@ -134,8 +134,8 @@ func createTrackAutoCmd() *cobra.Command {
134134 RunE : func (_ * cobra.Command , _ []string ) error {
135135 selections := & tracker.Selections {
136136 OutputFormat : outputFormat ,
137- BaselineTag : baselineTag ,
138- CurrentTag : currentTag ,
137+ Baseline : Baseline ,
138+ Current : Current ,
139139 ProfileType : profileType ,
140140 BenchmarkName : benchmarkName ,
141141 RegressionThreshold : regressionThreshold ,
@@ -146,16 +146,16 @@ func createTrackAutoCmd() *cobra.Command {
146146 Example : example ,
147147 }
148148
149- cmd .Flags ().StringVar (& baselineTag , baseTagFlag , "" , "Name of the baseline tag" )
150- cmd .Flags ().StringVar (& currentTag , currentTagFlag , "" , "Name of the current tag" )
149+ cmd .Flags ().StringVar (& Baseline , baseTagFlag , "" , "Name of the baseline tag" )
150+ cmd .Flags ().StringVar (& Current , currentFlag , "" , "Name of the current tag" )
151151 cmd .Flags ().StringVar (& benchmarkName , benchNameFlag , "" , "Name of the benchmark" )
152152 cmd .Flags ().StringVar (& profileType , profileTypeFlag , "" , "Profile type (cpu, memory, mutex, block)" )
153153 cmd .Flags ().StringVar (& outputFormat , outputFormatFlag , "detailed" , `Output format: "summary" or "detailed"` )
154154 cmd .Flags ().BoolVar (& failOnRegression , failFlag , false , "Exit with non-zero code if regression exceeds threshold" )
155155 cmd .Flags ().Float64Var (& regressionThreshold , thresholdFlag , 0.0 , "Fail when worst flat regression exceeds this percent (e.g., 5.0)" )
156156
157157 _ = cmd .MarkFlagRequired (baseTagFlag )
158- _ = cmd .MarkFlagRequired (currentTagFlag )
158+ _ = cmd .MarkFlagRequired (currentFlag )
159159 _ = cmd .MarkFlagRequired (benchNameFlag )
160160 _ = cmd .MarkFlagRequired (profileTypeFlag )
161161
@@ -176,8 +176,8 @@ func createTrackManualCmd() *cobra.Command {
176176 RunE : func (_ * cobra.Command , _ []string ) error {
177177 selections := & tracker.Selections {
178178 OutputFormat : outputFormat ,
179- BaselineTag : baselineTag ,
180- CurrentTag : currentTag ,
179+ Baseline : Baseline ,
180+ Current : Current ,
181181 ProfileType : profileType ,
182182 BenchmarkName : benchmarkName ,
183183 RegressionThreshold : regressionThreshold ,
@@ -189,8 +189,8 @@ func createTrackManualCmd() *cobra.Command {
189189 Example : example ,
190190 }
191191
192- cmd .Flags ().StringVar (& baselineTag , baseFlag , "" , "Name of the baseline tag" )
193- cmd .Flags ().StringVar (& currentTag , currentFlag , "" , "Name of the current tag" )
192+ cmd .Flags ().StringVar (& Baseline , baseFlag , "" , "Name of the baseline tag" )
193+ cmd .Flags ().StringVar (& Current , currentFlag , "" , "Name of the current tag" )
194194 cmd .Flags ().StringVar (& outputFormat , outputFormatFlag , "" , "Output format choice choice" )
195195 cmd .Flags ().BoolVar (& failOnRegression , failFlag , false , "Exit with non-zero code if regression exceeds threshold" )
196196 cmd .Flags ().Float64Var (& regressionThreshold , thresholdFlag , 0.0 , "Fail when worst flat regression exceeds this percent (e.g., 5.0)" )
@@ -225,24 +225,24 @@ func getTrackSelections(tags []string) (*tracker.Selections, error) {
225225 Options : tags ,
226226 PageSize : tuiPageSize ,
227227 }
228- if err := survey .AskOne (baselinePrompt , & selections .BaselineTag , survey .WithValidator (survey .Required )); err != nil {
228+ if err := survey .AskOne (baselinePrompt , & selections .Baseline , survey .WithValidator (survey .Required )); err != nil {
229229 return nil , err
230230 }
231231
232232 // Select current tag (filter out baseline)
233- var currentTagOptions []string
233+ var currentOptions []string
234234 for _ , tag := range tags {
235- if tag != selections .BaselineTag {
236- currentTagOptions = append (currentTagOptions , tag )
235+ if tag != selections .Baseline {
236+ currentOptions = append (currentOptions , tag )
237237 }
238238 }
239239
240240 currentPrompt := & survey.Select {
241241 Message : "Select current tag (the 'after' version) [Press Enter to select]:" ,
242- Options : currentTagOptions ,
242+ Options : currentOptions ,
243243 PageSize : tuiPageSize ,
244244 }
245- if err := survey .AskOne (currentPrompt , & selections .CurrentTag , survey .WithValidator (survey .Required )); err != nil {
245+ if err := survey .AskOne (currentPrompt , & selections .Current , survey .WithValidator (survey .Required )); err != nil {
246246 return nil , err
247247 }
248248
@@ -271,12 +271,12 @@ func getTrackSelections(tags []string) (*tracker.Selections, error) {
271271
272272// selectBenchmark discovers and selects a benchmark
273273func selectBenchmark (selections * tracker.Selections ) error {
274- availableBenchmarks , err := discoverAvailableBenchmarks (selections .BaselineTag )
274+ availableBenchmarks , err := discoverAvailableBenchmarks (selections .Baseline )
275275 if err != nil {
276- return fmt .Errorf ("failed to discover benchmarks for tag %s: %w" , selections .BaselineTag , err )
276+ return fmt .Errorf ("failed to discover benchmarks for tag %s: %w" , selections .Baseline , err )
277277 }
278278 if len (availableBenchmarks ) == 0 {
279- return fmt .Errorf ("no benchmarks found for tag %s" , selections .BaselineTag )
279+ return fmt .Errorf ("no benchmarks found for tag %s" , selections .Baseline )
280280 }
281281
282282 benchPrompt := & survey.Select {
@@ -289,12 +289,12 @@ func selectBenchmark(selections *tracker.Selections) error {
289289
290290// selectProfileType discovers and selects a profile type
291291func selectProfileType (selections * tracker.Selections ) error {
292- availableProfiles , err := discoverAvailableProfiles (selections .BaselineTag , selections .BenchmarkName )
292+ availableProfiles , err := discoverAvailableProfiles (selections .Baseline , selections .BenchmarkName )
293293 if err != nil {
294- return fmt .Errorf ("failed to discover profiles for tag %s, benchmark %s: %w" , selections .BaselineTag , selections .BenchmarkName , err )
294+ return fmt .Errorf ("failed to discover profiles for tag %s, benchmark %s: %w" , selections .Baseline , selections .BenchmarkName , err )
295295 }
296296 if len (availableProfiles ) == 0 {
297- return fmt .Errorf ("no profiles found for tag %s, benchmark %s" , selections .BaselineTag , selections .BenchmarkName )
297+ return fmt .Errorf ("no profiles found for tag %s, benchmark %s" , selections .Baseline , selections .BenchmarkName )
298298 }
299299
300300 profilePrompt := & survey.Select {
@@ -348,8 +348,8 @@ func selectRegressionThreshold(selections *tracker.Selections) error {
348348
349349// setGlobalTrackingVariables sets the global CLI variables for tracking
350350func setGlobalTrackingVariables (selections * tracker.Selections ) {
351- baselineTag = selections .BaselineTag
352- currentTag = selections .CurrentTag
351+ Baseline = selections .Baseline
352+ Current = selections .Current
353353 benchmarkName = selections .BenchmarkName
354354 profileType = selections .ProfileType
355355 outputFormat = selections .OutputFormat
@@ -540,7 +540,7 @@ func runTUITrackAuto(_ *cobra.Command, _ []string) error {
540540
541541 // Now run the actual tracking command
542542 fmt .Printf ("\n 🚀 Running: prof track auto --base %s --current %s --bench-name %s --profile-type %s --output-format %s" ,
543- selections .BaselineTag , selections .CurrentTag , selections .BenchmarkName , selections .ProfileType , selections .OutputFormat )
543+ selections .Baseline , selections .Current , selections .BenchmarkName , selections .ProfileType , selections .OutputFormat )
544544 if selections .UseThreshold {
545545 fmt .Printf (" --fail-on-regression --regression-threshold %.1f" , selections .RegressionThreshold )
546546 }
0 commit comments