Documentation ¶
Index ¶
- Constants
- func CompareSampleLabels(a, b []*profilev1.Label) int
- func FilterLabelsInPlace(labels []*profilev1.Label, keys []int64) int
- func FromBytes(input []byte, fn func(*profilev1.Profile, int) error) error
- func FromProfile(p *profile.Profile) (*profilev1.Profile, error)
- func LabelKeysByString(p *profilev1.Profile, keys ...string) []int64
- func LabelKeysMapByString(p *profilev1.Profile, keys ...string) map[string]int64
- func LabelsWithout(labels []*profilev1.Label, keys []int64) []*profilev1.Label
- func RenameLabel(p *profilev1.Profile, oldName, newName string)
- type LabelsByKeyValue
- type Profile
- type SampleExporter
- type SampleGroup
- type SampleHasher
- type SamplesByLabels
Constants ¶
const ( ProfileIDLabelName = "profile_id" // For compatibility with the existing clients. SpanIDLabelName = "span_id" // Will be supported in the future. )
Variables ¶
This section is empty.
Functions ¶
func CompareSampleLabels ¶ added in v1.1.0
CompareSampleLabels compares sample label pairs. It's expected that sample labels are sorted. The result will be 0 if a == b, < 0 if a < b, and > 0 if a > b.
func FilterLabelsInPlace ¶ added in v1.1.0
func LabelKeysByString ¶ added in v1.1.0
func LabelKeysMapByString ¶ added in v1.1.0
func LabelsWithout ¶ added in v1.1.0
func RenameLabel ¶ added in v1.1.0
Types ¶
type LabelsByKeyValue ¶ added in v1.1.0
func (LabelsByKeyValue) Len ¶ added in v1.1.0
func (l LabelsByKeyValue) Len() int
func (LabelsByKeyValue) Less ¶ added in v1.1.0
func (l LabelsByKeyValue) Less(i, j int) bool
func (LabelsByKeyValue) Swap ¶ added in v1.1.0
func (l LabelsByKeyValue) Swap(i, j int)
type Profile ¶
func NewProfile ¶ added in v1.1.0
func NewProfile() *Profile
func RawFromBytes ¶
Read RawProfile from bytes
func RawFromProto ¶ added in v1.1.0
func (*Profile) Normalize ¶
func (p *Profile) Normalize()
Normalize normalizes the profile by:
- Removing all duplicate samples (summing their values).
- Removing redundant profile labels (byte => unique of an allocation site) todo: We should reassess if this was a good choice because by merging duplicate stacktrace samples we cannot recompute the allocation per site ("bytes") profile label.
- Removing empty samples.
- Then remove unused references.
- Ensure that the profile has a time_nanos set
- Removes addresses from symbolized profiles.
type SampleExporter ¶ added in v1.1.0
type SampleExporter struct {
// contains filtered or unexported fields
}
func NewSampleExporter ¶ added in v1.1.0
func NewSampleExporter(p *profilev1.Profile) *SampleExporter
func (*SampleExporter) ExportSamples ¶ added in v1.1.0
func (e *SampleExporter) ExportSamples(dst *profilev1.Profile, samples []*profilev1.Sample) *profilev1.Profile
ExportSamples creates a new complete profile with the subset of samples provided. It is assumed that those are part of the source profile. Provided samples are modified in place.
The same exporter instance can be used to export non-overlapping sample sets from a single profile.
type SampleGroup ¶ added in v1.1.0
func GroupSamplesByLabels ¶ added in v1.1.0
func GroupSamplesByLabels(p *profilev1.Profile) []SampleGroup
GroupSamplesByLabels splits samples into groups by labels. It's expected that sample labels are sorted.
func GroupSamplesWithoutLabels ¶ added in v1.1.0
func GroupSamplesWithoutLabels(p *profilev1.Profile, labels ...string) []SampleGroup
GroupSamplesWithoutLabels splits samples into groups by labels ignoring ones from the list: those are preserved as sample labels. It's expected that sample labels are sorted.
func GroupSamplesWithoutLabelsByKey ¶ added in v1.1.0
func GroupSamplesWithoutLabelsByKey(p *profilev1.Profile, keys []int64) []SampleGroup
type SampleHasher ¶ added in v1.1.0
type SampleHasher struct {
// contains filtered or unexported fields
}
type SamplesByLabels ¶ added in v1.1.0
func (SamplesByLabels) Len ¶ added in v1.1.0
func (s SamplesByLabels) Len() int
func (SamplesByLabels) Less ¶ added in v1.1.0
func (s SamplesByLabels) Less(i, j int) bool
func (SamplesByLabels) Swap ¶ added in v1.1.0
func (s SamplesByLabels) Swap(i, j int)