MCPcopy Create free account
hub / github.com/google/pprof / openBrowser

Function openBrowser

internal/driver/webui.go:235–257  ·  view source on GitHub ↗
(url string, o *plugin.Options)

Source from the content-addressed store, hash-verified

233}
234
235func openBrowser(url string, o *plugin.Options) {
236 // Construct URL.
237 baseURL, _ := gourl.Parse(url)
238 current := currentConfig()
239 u, _ := current.makeURL(*baseURL)
240
241 // Give server a little time to get ready.
242 time.Sleep(time.Millisecond * 500)
243
244 for _, b := range browsers() {
245 args := strings.Split(b, " ")
246 if len(args) == 0 {
247 continue
248 }
249 viewer := exec.Command(args[0], append(args[1:], u.String())...)
250 viewer.Stderr = os.Stderr
251 if err := viewer.Start(); err == nil {
252 return
253 }
254 }
255 // No visualizer succeeded, so just print URL.
256 o.UI.PrintErr(u.String())
257}
258
259// makeReport generates a report for the specified command.
260// If configEditor is not null, it is used to edit the config used for the report.

Callers 1

serveWebInterfaceFunction · 0.85

Calls 6

currentConfigFunction · 0.85
browsersFunction · 0.85
makeURLMethod · 0.80
ParseMethod · 0.65
StringMethod · 0.65
PrintErrMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…