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

Function TestDocURLInLabels

internal/report/report_test.go:583–599  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

581}
582
583func TestDocURLInLabels(t *testing.T) {
584 const url = "http://example.com/pprof-help"
585 profile := testProfile.Copy()
586 profile.DocURL = url
587 rpt := New(profile, &Options{
588 OutputFormat: Text,
589 Symbol: regexp.MustCompile(`.`),
590 TrimPath: "/some/path",
591 SampleValue: func(v []int64) int64 { return v[1] },
592 SampleUnit: testProfile.SampleType[1].Unit,
593 })
594
595 labels := fmt.Sprintf("%v", ProfileLabels(rpt))
596 if !strings.Contains(labels, url) {
597 t.Errorf("expected URL %q not found in %s", url, labels)
598 }
599}
600
601func TestProfileLabels(t *testing.T) {
602 // Force the local timezone to UTC for the duration of this function to get a

Callers

nothing calls this directly

Calls 3

ProfileLabelsFunction · 0.85
CopyMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…