Documentation
¶
Index ¶
- Variables
- func Runtime_cyclesPerSecond() int64
- func ScaleHeapSample(count, size, rate int64) (int64, int64)
- func ScaleMutexProfile(_ MutexProfileScaler, cnt int64, ns float64) (int64, float64)
- type DeltaHeapProfiler
- type DeltaMutexProfiler
- type MutexProfileScaler
- type ProfileBuilder
- type ProfileBuilderOptions
- type ProfileConfig
- type ValueType
Constants ¶
This section is empty.
Variables ¶
var ScalerBlockProfile = MutexProfileScaler{}
var ScalerMutexProfile = MutexProfileScaler{}
Functions ¶
func Runtime_cyclesPerSecond ¶ added in v0.1.6
func Runtime_cyclesPerSecond() int64
func ScaleHeapSample ¶ added in v0.1.8
ScaleHeapSample adjusts the data from a heap Sample to account for its probability of appearing in the collected data. heap profiles are a sampling of the memory allocations requests in a program. We estimate the unsampled value by dividing each collected sample by its probability of appearing in the profile. heap profiles rely on a poisson process to determine which samples to collect, based on the desired average collection rate R. The probability of a sample of size S to appear in that profile is 1-exp(-S/R).
func ScaleMutexProfile ¶ added in v0.1.6
func ScaleMutexProfile(_ MutexProfileScaler, cnt int64, ns float64) (int64, float64)
ScaleMutexProfile is a no-op for go1.20+. https://github.com/golang/go/commit/30b1af00ff142a3f1a5e2a0f32cf04a649bd5e65
Types ¶
type DeltaHeapProfiler ¶
type DeltaHeapProfiler struct {
// contains filtered or unexported fields
}
func (*DeltaHeapProfiler) WriteHeapProto ¶
func (d *DeltaHeapProfiler) WriteHeapProto(b ProfileBuilder, p []runtime.MemProfileRecord, rate int64) error
WriteHeapProto writes the current heap profile in protobuf format to w.
type DeltaMutexProfiler ¶
type DeltaMutexProfiler struct {
// contains filtered or unexported fields
}
func (*DeltaMutexProfiler) PrintCountCycleProfile ¶
func (d *DeltaMutexProfiler) PrintCountCycleProfile(b ProfileBuilder, scaler MutexProfileScaler, records []runtime.BlockProfileRecord) error
PrintCountCycleProfile outputs block profile records (for block or mutex profiles) as the pprof-proto format output. Translations from cycle count to time duration are done because The proto expects count and time (nanoseconds) instead of count and the number of cycles for block, contention profiles. Possible 'scaler' functions are scaleBlockProfile and scaleMutexProfile.
type MutexProfileScaler ¶ added in v0.1.4
type MutexProfileScaler struct {
}
type ProfileBuilder ¶ added in v0.1.8
type ProfileBuilder interface {
LocsForStack(stk []uintptr) (newLocs []uint64)
Sample(values []int64, locs []uint64, blockSize int64)
Build()
}
func NewProfileBuilder ¶ added in v0.1.8
func NewProfileBuilder(w io.Writer, opt *ProfileBuilderOptions, stc ProfileConfig) ProfileBuilder
NewProfileBuilder returns a new profileBuilder. CPU profiling data obtained from the runtime can be added by calling b.addCPUData, and then the eventual profile can be obtained by calling b.finish.
type ProfileBuilderOptions ¶ added in v0.1.6
type ProfileBuilderOptions struct {
// for go1.21+ if true - use runtime_FrameSymbolName - produces frames with generic types, for example [go.shape.int]
// for go1.21+ if false - use runtime.Frame->Function - produces frames with generic types ommited [...]
// pre 1.21 - always use runtime.Frame->Function - produces frames with generic types ommited [...]
GenericsFrames bool
LazyMapping bool
// contains filtered or unexported fields
}
type ProfileConfig ¶ added in v0.1.8
type ProfileConfig struct {
PeriodType ValueType
Period int64
SampleType []ValueType
DefaultSampleType string
}
func HeapProfileConfig ¶ added in v0.1.8
func HeapProfileConfig(rate int64) ProfileConfig
func MutexProfileConfig ¶ added in v0.1.8
func MutexProfileConfig() ProfileConfig