profile

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstantProfile

type InstantProfile interface {
	ProfileMeta() InstantProfileMeta
	Samples() map[string]*Sample
}

func NewScaledInstantProfile

func NewScaledInstantProfile(p InstantProfile, ratio float64) InstantProfile

type InstantProfileMeta

type InstantProfileMeta struct {
	PeriodType ValueType
	SampleType ValueType
	Timestamp  int64
	Duration   int64
	Period     int64
}

func MetaFromPprof added in v0.8.0

func MetaFromPprof(p *profile.Profile, sampleIndex int) InstantProfileMeta

type Profile added in v0.9.0

type Profile struct {
	Meta        InstantProfileMeta
	FlatSamples map[string]*Sample
}

func CopyInstantProfile added in v0.9.0

func CopyInstantProfile(p InstantProfile) *Profile

func FromPprof added in v0.9.0

func FromPprof(ctx context.Context, logger log.Logger, metaStore metastore.ProfileMetaStore, p *profile.Profile, sampleIndex int, normalized bool) (*Profile, error)

func ProfilesFromPprof added in v0.9.0

func ProfilesFromPprof(ctx context.Context, l log.Logger, s metastore.ProfileMetaStore, p *profile.Profile, normalized bool) ([]*Profile, error)

ProfilesFromPprof extracts a Profile from each sample index included in the pprof profile.

func (*Profile) ProfileMeta added in v0.9.0

func (fp *Profile) ProfileMeta() InstantProfileMeta

func (*Profile) Samples added in v0.9.0

func (fp *Profile) Samples() map[string]*Sample

type Sample

type Sample struct {
	Location  []*metastore.Location
	Value     int64
	DiffValue int64
	Label     map[string][]string
	NumLabel  map[string][]int64
	NumUnit   map[string][]string
}

func MakeSample

func MakeSample(value int64, locationIds []uuid.UUID) *Sample

MakeSample creates a sample from a stack trace (list of locations) and a value. Mostly meant for testing.

type ScaledInstantProfile

type ScaledInstantProfile struct {
	// contains filtered or unexported fields
}

func (*ScaledInstantProfile) ProfileMeta

func (p *ScaledInstantProfile) ProfileMeta() InstantProfileMeta

func (*ScaledInstantProfile) Samples

func (p *ScaledInstantProfile) Samples() map[string]*Sample

type StacktraceKey

type StacktraceKey []byte

func MakeStacktraceKey

func MakeStacktraceKey(sample *Sample) StacktraceKey

MakeStacktraceKey generates stacktraceKey to be used as a key for maps.

type ValueType

type ValueType struct {
	Type string
	Unit string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL