]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/vendor: pull in golang.org/x/telemetry@b4de734
authorMichael Matloob <matloob@golang.org>
Fri, 21 Jun 2024 18:49:21 +0000 (14:49 -0400)
committerMichael Matloob <matloob@golang.org>
Fri, 21 Jun 2024 19:37:40 +0000 (19:37 +0000)
Commands run:
go get golang.org/x/telemetry@b4de734
go mod tidy
go mod vendor

For #68109

Change-Id: Ied81cbb111ed66f9bbc94f0db09b5f2430fbff6f
Reviewed-on: https://go-review.googlesource.com/c/go/+/594015
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/go.mod
src/cmd/go.sum
src/cmd/vendor/golang.org/x/telemetry/counter/counter.go
src/cmd/vendor/modules.txt

index 559ffd1ccdc5b5d78f95cf78c1ab70a1a0f5a8ce..0625195931d7bf4237b64e702cd52a741e574dfa 100644 (file)
@@ -9,7 +9,7 @@ require (
        golang.org/x/mod v0.18.0
        golang.org/x/sync v0.7.0
        golang.org/x/sys v0.21.0
-       golang.org/x/telemetry v0.0.0-20240612191826-8cad58b3fcbb
+       golang.org/x/telemetry v0.0.0-20240621183135-b4de734908f6
        golang.org/x/term v0.20.0
        golang.org/x/tools v0.22.1-0.20240618181713-f2d2ebe43e72
 )
index 8f9517bc624754d183b8a1293a92940dada732c1..25276c92b2e8b9f40ec400a1e8efe82926cf5421 100644 (file)
@@ -16,8 +16,8 @@ golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
 golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
 golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
 golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/telemetry v0.0.0-20240612191826-8cad58b3fcbb h1:0Ge50tvTqbHEyuQDgCYypgL2afqNjRNdl4GHPJuN9QY=
-golang.org/x/telemetry v0.0.0-20240612191826-8cad58b3fcbb/go.mod h1:n38mvGdgc4dA684EC4NwQwoPKSw4jyKw8/DgZHDA1Dk=
+golang.org/x/telemetry v0.0.0-20240621183135-b4de734908f6 h1:2+8QyQRLYDeEKd+CM/BsuaBaLdhAsNdasS/SnZfPS9g=
+golang.org/x/telemetry v0.0.0-20240621183135-b4de734908f6/go.mod h1:n38mvGdgc4dA684EC4NwQwoPKSw4jyKw8/DgZHDA1Dk=
 golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
 golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
 golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
index ba1c68889e1ec0ea35e05f37f4235fb10aa863cf..7a7e66b22d1714f49e7fda57e6d62575e6751203 100644 (file)
@@ -15,6 +15,7 @@ import (
        "runtime/debug"
 
        "golang.org/x/telemetry/internal/counter"
+       "golang.org/x/telemetry/internal/telemetry"
 )
 
 // Inc increments the counter with the given name.
@@ -83,11 +84,26 @@ func NewStack(name string, depth int) *StackCounter {
 // counter file on disk and starts to mmap telemetry counters to the file.
 // Open also persists any counters already created in the current process.
 //
-// Programs using telemetry should call Open exactly once.
+// Programs using telemetry should call either Open or OpenDir exactly once.
 func Open() {
        counter.Open()
 }
 
+// OpenDir prepares telemetry counters for recording to the file system, using
+// the specified telemetry directory, if it is not the empty string.
+//
+// If the telemetry mode is "off", Open is a no-op. Otherwise, it opens the
+// counter file on disk and starts to mmap telemetry counters to the file.
+// Open also persists any counters already created in the current process.
+//
+// Programs using telemetry should call either Open or OpenDir exactly once.
+func OpenDir(telemetryDir string) {
+       if telemetryDir != "" {
+               telemetry.Default = telemetry.NewDir(telemetryDir)
+       }
+       counter.Open()
+}
+
 // CountFlags creates a counter for every flag that is set
 // and increments the counter. The name of the counter is
 // the concatenation of prefix and the flag name.
index 8ba7df290fa0c1b012ada0b6601570d6ef2d3958..fc1f25588a8363af0a6fb2608120dc868430e952 100644 (file)
@@ -45,7 +45,7 @@ golang.org/x/sync/semaphore
 golang.org/x/sys/plan9
 golang.org/x/sys/unix
 golang.org/x/sys/windows
-# golang.org/x/telemetry v0.0.0-20240612191826-8cad58b3fcbb
+# golang.org/x/telemetry v0.0.0-20240621183135-b4de734908f6
 ## explicit; go 1.20
 golang.org/x/telemetry
 golang.org/x/telemetry/counter