...
1
2
3
4
5
6
7 package telemetrystats
8
9 import (
10 "cmd/go/internal/base"
11 "cmd/go/internal/cfg"
12 "cmd/go/internal/modload"
13 "cmd/internal/telemetry/counter"
14 )
15
16 func Increment() {
17 incrementConfig()
18 incrementVersionCounters()
19 }
20
21
22
23 func incrementConfig() {
24 if !modload.WillBeEnabled() {
25 counter.Inc("go/mode:gopath")
26 } else if workfile := modload.FindGoWork(base.Cwd()); workfile != "" {
27 counter.Inc("go/mode:workspace")
28 } else {
29 counter.Inc("go/mode:module")
30 }
31 counter.Inc("go/platform/target/goos:" + cfg.Goos)
32 counter.Inc("go/platform/target/goarch:" + cfg.Goarch)
33 switch cfg.Goarch {
34 case "386":
35 counter.Inc("go/platform/target/go386:" + cfg.GO386)
36 case "amd64":
37 counter.Inc("go/platform/target/goamd64:" + cfg.GOAMD64)
38 case "arm":
39 counter.Inc("go/platform/target/goarm:" + cfg.GOARM)
40 case "arm64":
41 counter.Inc("go/platform/target/goarm64:" + cfg.GOARM64)
42 case "mips":
43 counter.Inc("go/platform/target/gomips:" + cfg.GOMIPS)
44 case "ppc64":
45 counter.Inc("go/platform/target/goppc64:" + cfg.GOPPC64)
46 case "riscv64":
47 counter.Inc("go/platform/target/goriscv64:" + cfg.GORISCV64)
48 case "wasm":
49 counter.Inc("go/platform/target/gowasm:" + cfg.GOWASM)
50 }
51 }
52
View as plain text