MCPcopy Create free account
hub / github.com/dispatchrun/wzprof / NewProfile

Method NewProfile

mem.go:71–76  ·  view source on GitHub ↗

NewProfile takes a snapshot of the current memory allocation state and builds a profile representing the state of the program memory.

(sampleRate float64)

Source from the content-addressed store, hash-verified

69// NewProfile takes a snapshot of the current memory allocation state and builds
70// a profile representing the state of the program memory.
71func (p *MemoryProfiler) NewProfile(sampleRate float64) *profile.Profile {
72 ratio := 1 / sampleRate
73 return buildProfile(p.p, p.snapshot(), p.start, time.Since(p.start), p.SampleType(),
74 []float64{ratio, ratio, ratio, ratio},
75 )
76}
77
78// Name returns "allocs" to match the name of the memory profiler in pprof.
79func (p *MemoryProfiler) Name() string {

Callers 2

NewHandlerMethod · 0.95
runMethod · 0.80

Calls 3

snapshotMethod · 0.95
SampleTypeMethod · 0.95
buildProfileFunction · 0.85

Tested by

no test coverage detected