Skip to content

Commit 7e37533

Browse files
hyangahgopherbot
authored andcommitted
config: temporarily add gopls@devel to allowed program versions
And increase the default rate from 0.1 to 1.0. Since the telemetry is opt-in and we are still under development, we need a higher sampling rate. For golang/go#62271 Change-Id: I907f9a143878ab20238dd5b1ce71fde4afc24df7 Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/523699 Reviewed-by: Robert Findley <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Jamal Carvalho <[email protected]> Auto-Submit: Hyang-Ah Hana Kim <[email protected]>
1 parent 0953a66 commit 7e37533

File tree

5 files changed

+16
-24
lines changed

5 files changed

+16
-24
lines changed

config/config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,13 @@
496496
"v1.2.3-pre.2",
497497
"v1.2.3-pre.3",
498498
"v1.2.3-pre.4",
499-
"v1.2.3"
499+
"v1.2.3",
500+
"devel"
500501
],
501502
"Counters": [
502503
{
503504
"Name": "gopls/client:{vscode,vscodium,code-server,eglot,govim,neovim,coc.nvim,sublimetext,other}",
504-
"Rate": 0.1
505+
"Rate": 1
505506
}
506507
]
507508
}

config/doc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
//
77
// This package contains no actual Go code, and exists only so the config.json
88
// file can be served by module proxies.
9+
//
10+
// The config.json is generated by golang.org/x/telemetry/internal/configgen.
911
package config

internal/configgen/main.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:generate go run . -w
6+
57
//go:build go1.21
68

79
// Package configgen generates the upload config file stored in the config.json
@@ -174,7 +176,7 @@ func generate(graphConfig []byte, padding padding) (*telemetry.UploadConfig, err
174176
minVersions[gcfg.Program] = minVersion(minVersions[gcfg.Program], gcfg.Version)
175177
ccfg := telemetry.CounterConfig{
176178
Name: gcfg.Counter,
177-
Rate: 0.1, // TODO(rfindley): how should rate be configured?
179+
Rate: 1.0, // TODO(rfindley): how should rate be configured?
178180
Depth: gcfg.Depth,
179181
}
180182
if gcfg.Depth > 0 {
@@ -205,6 +207,10 @@ func generate(graphConfig []byte, padding padding) (*telemetry.UploadConfig, err
205207
}
206208
}
207209
p.Versions = padVersions(versions[:i], prereleasesForProgram(p.Name), padding)
210+
// TODO(hakim): allow to collect counters from gopls@devel. go.dev/issues/62271
211+
if p.Name == "golang.org/x/tools/gopls" {
212+
p.Versions = append(p.Versions, "devel") // added at the end.
213+
}
208214
ucfg.Programs = append(ucfg.Programs, p)
209215
}
210216
sort.Slice(ucfg.Programs, func(i, j int) bool {

internal/configgen/main_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ version: v0.14.0
6464
"v1.0.1-pre.1",
6565
"v1.0.1-pre.2",
6666
"v1.0.1",
67+
"devel", // Added for go.dev/issues/62271,
6768
},
6869
Counters: []telemetry.CounterConfig{{
6970
Name: "gopls/editor:{emacs,vim,vscode,other}",
70-
Rate: 0.1,
71+
Rate: 1.0,
7172
}},
7273
}},
7374
}
@@ -125,10 +126,11 @@ func TestContains(t *testing.T) {
125126
"v0.15.1-pre.1",
126127
"v0.15.1-pre.2",
127128
"v0.15.1",
129+
"devel", // Added for go.dev/issues/62271,
128130
},
129131
Counters: []telemetry.CounterConfig{{
130132
Name: "gopls/editor:{emacs,vim,vscode,other}",
131-
Rate: 0.1,
133+
Rate: 1.0,
132134
}},
133135
}},
134136
}

internal/configgen/syslist.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,6 @@ var knownOS = map[string]bool{
3030
"zos": true,
3131
}
3232

33-
// unixOS is the set of GOOS values matched by the "unix" build tag.
34-
// This is not used for filename matching.
35-
// This list also appears in cmd/dist/build.go and
36-
// cmd/go/internal/imports/build.go.
37-
var unixOS = map[string]bool{
38-
"aix": true,
39-
"android": true,
40-
"darwin": true,
41-
"dragonfly": true,
42-
"freebsd": true,
43-
"hurd": true,
44-
"illumos": true,
45-
"ios": true,
46-
"linux": true,
47-
"netbsd": true,
48-
"openbsd": true,
49-
"solaris": true,
50-
}
51-
5233
// knownArch is the list of past, present, and future known GOARCH values.
5334
// Do not remove from this list, as it is used for filename matching.
5435
var knownArch = map[string]bool{

0 commit comments

Comments
 (0)