Skip to content

Commit

Permalink
config: temporarily add gopls@devel to allowed program versions
Browse files Browse the repository at this point in the history
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 <rfindley@google.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com>
  • Loading branch information
hyangah authored and gopherbot committed Aug 29, 2023
1 parent 0953a66 commit 7e37533
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
5 changes: 3 additions & 2 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -496,12 +496,13 @@
"v1.2.3-pre.2",
"v1.2.3-pre.3",
"v1.2.3-pre.4",
"v1.2.3"
"v1.2.3",
"devel"
],
"Counters": [
{
"Name": "gopls/client:{vscode,vscodium,code-server,eglot,govim,neovim,coc.nvim,sublimetext,other}",
"Rate": 0.1
"Rate": 1
}
]
}
Expand Down
2 changes: 2 additions & 0 deletions config/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
//
// This package contains no actual Go code, and exists only so the config.json
// file can be served by module proxies.
//
// The config.json is generated by golang.org/x/telemetry/internal/configgen.
package config
8 changes: 7 additions & 1 deletion internal/configgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:generate go run . -w

//go:build go1.21

// Package configgen generates the upload config file stored in the config.json
Expand Down Expand Up @@ -174,7 +176,7 @@ func generate(graphConfig []byte, padding padding) (*telemetry.UploadConfig, err
minVersions[gcfg.Program] = minVersion(minVersions[gcfg.Program], gcfg.Version)
ccfg := telemetry.CounterConfig{
Name: gcfg.Counter,
Rate: 0.1, // TODO(rfindley): how should rate be configured?
Rate: 1.0, // TODO(rfindley): how should rate be configured?
Depth: gcfg.Depth,
}
if gcfg.Depth > 0 {
Expand Down Expand Up @@ -205,6 +207,10 @@ func generate(graphConfig []byte, padding padding) (*telemetry.UploadConfig, err
}
}
p.Versions = padVersions(versions[:i], prereleasesForProgram(p.Name), padding)
// TODO(hakim): allow to collect counters from gopls@devel. go.dev/issues/62271
if p.Name == "golang.org/x/tools/gopls" {
p.Versions = append(p.Versions, "devel") // added at the end.
}
ucfg.Programs = append(ucfg.Programs, p)
}
sort.Slice(ucfg.Programs, func(i, j int) bool {
Expand Down
6 changes: 4 additions & 2 deletions internal/configgen/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ version: v0.14.0
"v1.0.1-pre.1",
"v1.0.1-pre.2",
"v1.0.1",
"devel", // Added for go.dev/issues/62271,
},
Counters: []telemetry.CounterConfig{{
Name: "gopls/editor:{emacs,vim,vscode,other}",
Rate: 0.1,
Rate: 1.0,
}},
}},
}
Expand Down Expand Up @@ -125,10 +126,11 @@ func TestContains(t *testing.T) {
"v0.15.1-pre.1",
"v0.15.1-pre.2",
"v0.15.1",
"devel", // Added for go.dev/issues/62271,
},
Counters: []telemetry.CounterConfig{{
Name: "gopls/editor:{emacs,vim,vscode,other}",
Rate: 0.1,
Rate: 1.0,
}},
}},
}
Expand Down
19 changes: 0 additions & 19 deletions internal/configgen/syslist.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,6 @@ var knownOS = map[string]bool{
"zos": true,
}

// unixOS is the set of GOOS values matched by the "unix" build tag.
// This is not used for filename matching.
// This list also appears in cmd/dist/build.go and
// cmd/go/internal/imports/build.go.
var unixOS = map[string]bool{
"aix": true,
"android": true,
"darwin": true,
"dragonfly": true,
"freebsd": true,
"hurd": true,
"illumos": true,
"ios": true,
"linux": true,
"netbsd": true,
"openbsd": true,
"solaris": true,
}

// knownArch is the list of past, present, and future known GOARCH values.
// Do not remove from this list, as it is used for filename matching.
var knownArch = map[string]bool{
Expand Down

0 comments on commit 7e37533

Please sign in to comment.