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

Function TestIsLocalHost

internal/driver/webui_test.go:292–303  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

290}
291
292func TestIsLocalHost(t *testing.T) {
293 for _, s := range []string{"localhost:10000", "[::1]:10000", "127.0.0.1:10000"} {
294 host, _, err := net.SplitHostPort(s)
295 if err != nil {
296 t.Error("unexpected error when splitting", s)
297 continue
298 }
299 if !isLocalhost(host) {
300 t.Errorf("host %s from %s not considered local", host, s)
301 }
302 }
303}
304
305func BenchmarkTop(b *testing.B) { benchmarkURL(b, "/top", false) }
306func BenchmarkFlame(b *testing.B) { benchmarkURL(b, "/flamegraph", false) }

Callers

nothing calls this directly

Calls 1

isLocalhostFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…