Skip to content

Commit

Permalink
Disable Go telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Oct 3, 2024
1 parent b0ef1a9 commit 092f25b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Deprecate `install_go()`. Visit <https://go.dev/dl/> to download the appropriate build of Go for your platform.
* Use the copy of `pprof` that comes with Go.
* Disable Go telemetry to comply with CRAN policies.

# proffer 0.1.6

Expand Down
22 changes: 13 additions & 9 deletions R/pprof.R
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,18 @@ show_url <- function(host, port) {
}

serve_pprof_impl <- function(args) {
with_safe_path(
Sys.getenv("PROFFER_GRAPHVIZ_BIN"),
processx::process$new(
command = go_bin_path(),
args = c("tool", "pprof", args),
stdout = "|",
stderr = "|",
supervise = TRUE
)
processx::run(
command = go_bin_path(),
args = c("telemetry", "off"),
stdout = "|",
stderr = "|",
error_on_status = FALSE
)
processx::process$new(
command = go_bin_path(),
args = c("tool", "pprof", args),
stdout = "|",
stderr = "|",
supervise = TRUE
)
}
4 changes: 4 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ When you are done testing, you can clean up the process to conserve resources.
process$kill()
```

## Telemetry

Recent versions of Go implement telemetry by default. Functions in `proffer` such as `pprof()` turn off telemetry in order to comply with CRAN policies. Read <https://go.dev/doc/telemetry> to learn how to restore telemetry settings after using `proffer`.

## Contributing

We encourage participation through [issues](https://github.com/r-prof/proffer/issues) and [pull requests](https://github.com/r-prof/proffer/pulls). `proffer` has a [Contributor Code of Conduct](https://github.com/r-prof/proffer/blob/main/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ system.time({
x <- data.frame(x = x, y = y)
})
#> user system elapsed
#> 0.018 0.001 0.019
#> 0.019 0.001 0.020
```

Moral of the story: before you optimize, throw away your assumptions and
Expand Down Expand Up @@ -221,6 +221,13 @@ resources.
process$kill()
```

## Telemetry

Recent versions of Go implement telemetry by default. Functions in
`proffer` such as `pprof()` turn off telemetry in order to comply with
CRAN policies. Read <https://go.dev/doc/telemetry> to learn how to
restore telemetry settings after using `proffer`.

## Contributing

We encourage participation through
Expand Down

0 comments on commit 092f25b

Please sign in to comment.