Skip to content

Commit a2b48b6

Browse files
mknyszekgopherbot
authored andcommitted
cmd/bench: emit builder name as benchmark key
The purpose of emitting the builder name is to help group results together further down the pipeline, specifically to produce a useful geomean. Change-Id: I99c04012ba48e795768b824d073f84af303dcfc3 Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/627516 Auto-Submit: Michael Knyszek <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent 732bef8 commit a2b48b6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmd/bench/main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var (
3131
repository = flag.String("repository", "", "repository name of the commits we're testing against (default $BENCH_REPOSITORY or 'go')")
3232
subRepoExperiment = flag.String("subrepo", "", "Sub-repo dir to test (default $BENCH_SUBREPO_PATH)")
3333
subRepoBaseline = flag.String("subrepo-baseline", "", "Sub-repo baseline to test against (default $BENCH_SUBREPO_BASELINE_PATH)")
34+
builderName = flag.String("builder", "", "The name of the CI builder the benchmarks were produced on (default $GO_BUILDER_NAME)")
3435
)
3536

3637
func determineGOROOT() (string, error) {
@@ -170,6 +171,15 @@ func main() {
170171
}
171172
fmt.Printf("branch: %s\n", branch)
172173

174+
// Try to identify the builder. Just omit the key if there isn't one.
175+
builder := *builderName
176+
if builder == "" {
177+
builder = os.Getenv("GO_BUILDER_NAME")
178+
}
179+
if builder != "" {
180+
fmt.Printf("builder: %s\n", builder)
181+
}
182+
173183
subRepoExperiment := *subRepoExperiment
174184
if subRepoExperiment == "" {
175185
subRepoExperiment = os.Getenv("BENCH_SUBREPO_PATH")

0 commit comments

Comments
 (0)