aboutsummaryrefslogtreecommitdiff
path: root/cmd/pkgsite
diff options
context:
space:
mode:
authorEthan Lee <ethanalee@google.com>2025-12-18 03:32:22 +0000
committerGopher Robot <gobot@golang.org>2025-12-22 05:58:08 -0800
commit7f1b33f0c89e24e50f13e2ad9636ce284daa4c65 (patch)
treef60eb2b2931aff28db716607dd7c26b686239307 /cmd/pkgsite
parenta7c442171859262d3fa27df3fecf6a88e7316e70 (diff)
downloadgo-x-pkgsite-7f1b33f0c89e24e50f13e2ad9636ce284daa4c65.tar.xz
internal/dcensus: add metrics for codewiki link usage
- Count link usage, target url and referrer page. - To avoid increasing dependency size, use indirection to call recordCodeWikiMetrics. Example: Run `go run ./cmd/frontend/main.go -dev -direct_proxy` and access pkgsite via localhost:8080. After clicking on the link, observe the relevant metric logged in localhost:8081/statz. Run `go test -v -run TestCmdPkgsiteDeps` to ensure that cmd/pkgsite dependencies remain stable. Change-Id: Ib312584162b81deac4c22b4ed923ff783133e11e Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/731020 Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Auto-Submit: Ethan Lee <ethanalee@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'cmd/pkgsite')
-rw-r--r--cmd/pkgsite/main.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmd/pkgsite/main.go b/cmd/pkgsite/main.go
index cd0a3b49..49b99a59 100644
--- a/cmd/pkgsite/main.go
+++ b/cmd/pkgsite/main.go
@@ -100,6 +100,7 @@ func main() {
serverCfg.UseLocalStdlib = true
serverCfg.GoRepoPath = *goRepoPath
serverCfg.Paths = collectPaths(flag.Args())
+ serverCfg.RecordCodeWikiMetrics = nil
if serverCfg.UseCache || *useProxy {
fmt.Fprintf(os.Stderr, "BYPASSING LICENSE CHECKING: MAY DISPLAY NON-REDISTRIBUTABLE INFORMATION\n")