Run telemetry.Start (without the upload) first thing so we can increment
counters in toolchain selection. Then run telemetry.StartWithUpload
after toolchain selection so we don't start the upload until after
toolchain selection has happened so we don't start something heavyweight
before selection.
Change-Id: Ia8979175a163265c3e29f6cb11a4ada4714d1d95
Reviewed-on: https://go-review.googlesource.com/c/go/+/585419
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
func main() {
log.SetFlags(0)
- telemetry.StartWithUpload() // Open the telemetry counter file so counters can be written to it.
+ telemetry.Start() // Open the telemetry counter file so counters can be written to it.
handleChdirFlag()
toolchain.Select()
+ telemetry.StartWithUpload() // Run the upload process. Opening the counter file is idempotent.
flag.Usage = base.Usage
flag.Parse()
telemetry.Inc("go/invocations")