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

Method SampleType

mem.go:98–115  ·  view source on GitHub ↗

SampleType returns the set of value types present in samples recorded by the memory profiler.

()

Source from the content-addressed store, hash-verified

96// SampleType returns the set of value types present in samples recorded by the
97// memory profiler.
98func (p *MemoryProfiler) SampleType() []*profile.ValueType {
99 sampleType := []*profile.ValueType{
100 {Type: "alloc_objects", Unit: "count"},
101 {Type: "alloc_space", Unit: "bytes"},
102 }
103
104 if p.inuse != nil {
105 // TODO: when can track freeing of garbage collected languages like Go,
106 // this should be enabled by default, and we can remove the slicing of
107 // sample values in buildProfile.
108 sampleType = append(sampleType,
109 &profile.ValueType{Type: "inuse_objects", Unit: "count"},
110 &profile.ValueType{Type: "inuse_space", Unit: "bytes"},
111 )
112 }
113
114 return sampleType
115}
116
117type memorySample struct {
118 stack stackTrace

Callers 1

NewProfileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected