Help us shape the future of Go! Take the 2026 Go Developer Survey

profile

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ColumnLabelsPrefix      = ColumnLabels + "."
	ColumnPprofLabelsPrefix = ColumnPprofLabels + "."
)
View Source
const (
	SchemaName = "parca"
	// The columns are sorted by their name in the schema too.
	ColumnDuration       = "duration"
	ColumnLabels         = "labels"
	ColumnName           = "name"
	ColumnPeriod         = "period"
	ColumnPeriodType     = "period_type"
	ColumnPeriodUnit     = "period_unit"
	ColumnPprofLabels    = "pprof_labels"
	ColumnPprofNumLabels = "pprof_num_labels"
	ColumnSampleType     = "sample_type"
	ColumnSampleUnit     = "sample_unit"
	ColumnStacktrace     = "stacktrace"
	ColumnTimestamp      = "timestamp"
	ColumnValue          = "value"
)

Variables

View Source
var LocationsField = arrow.Field{
	Name: "locations",
	Type: arrow.ListOf(arrow.StructOf([]arrow.Field{{
		Name: "address",
		Type: arrow.PrimitiveTypes.Uint64,
	}, {
		Name: "mapping_start",
		Type: arrow.PrimitiveTypes.Uint64,
	}, {
		Name: "mapping_limit",
		Type: arrow.PrimitiveTypes.Uint64,
	}, {
		Name: "mapping_offset",
		Type: arrow.PrimitiveTypes.Uint64,
	}, {
		Name: "mapping_file",
		Type: &arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Uint32, ValueType: arrow.BinaryTypes.Binary},
	}, {
		Name: "mapping_build_id",
		Type: &arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Uint32, ValueType: arrow.BinaryTypes.Binary},
	}, {
		Name: "lines",
		Type: arrow.ListOf(arrow.StructOf([]arrow.Field{{
			Name: "line",
			Type: arrow.PrimitiveTypes.Int64,
		}, {
			Name: "function_name",
			Type: &arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Uint32, ValueType: arrow.BinaryTypes.Binary},
		}, {
			Name: "function_system_name",
			Type: &arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Uint32, ValueType: arrow.BinaryTypes.Binary},
		}, {
			Name: "function_filename",
			Type: &arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Uint32, ValueType: arrow.BinaryTypes.Binary},
		}, {
			Name: "function_start_line",
			Type: arrow.PrimitiveTypes.Int64,
		}}...)),
	}}...)),
}

Functions

func ArrowSamplesField added in v0.19.0

func ArrowSamplesField(profileLabelFields []arrow.Field) []arrow.Field

func ArrowSchema added in v0.19.0

func ArrowSchema(profileLabelFields []arrow.Field) *arrow.Schema

func LocationsArrowSchema added in v0.19.0

func LocationsArrowSchema() *arrow.Schema

func Schema added in v0.19.0

func Schema() (*dynparquet.Schema, error)

func SchemaDefinition added in v0.19.0

func SchemaDefinition() *schemapb.Schema

Types

type Label added in v0.12.0

type Label struct {
	Name  string
	Value string
}

type LabelColumn added in v0.19.0

type LabelColumn struct {
	Col  *array.Uint32
	Dict *array.Binary
}

type Location added in v0.12.0

type Location struct {
	ID       string
	Address  uint64
	IsFolded bool
	Mapping  *pb.Mapping
	Lines    []LocationLine
}

type LocationLine added in v0.12.0

type LocationLine struct {
	Line     int64
	Function *pb.Function
}

type LocationsWriter added in v0.19.0

type LocationsWriter struct {
	RecordBuilder      *array.RecordBuilder
	LabelBuildersMap   map[string]*array.BinaryDictionaryBuilder
	LabelBuilders      []*array.BinaryDictionaryBuilder
	LocationsList      *array.ListBuilder
	Locations          *array.StructBuilder
	Addresses          *array.Uint64Builder
	MappingStart       *array.Uint64Builder
	MappingLimit       *array.Uint64Builder
	MappingOffset      *array.Uint64Builder
	MappingFile        *array.BinaryDictionaryBuilder
	MappingBuildID     *array.BinaryDictionaryBuilder
	Lines              *array.ListBuilder
	Line               *array.StructBuilder
	LineNumber         *array.Int64Builder
	FunctionName       *array.BinaryDictionaryBuilder
	FunctionSystemName *array.BinaryDictionaryBuilder
	FunctionFilename   *array.BinaryDictionaryBuilder
	FunctionStartLine  *array.Int64Builder
	Value              *array.Int64Builder
	Diff               *array.Int64Builder
}

func NewLocationsWriter added in v0.19.0

func NewLocationsWriter(pool memory.Allocator) LocationsWriter

type Meta added in v0.12.0

type Meta struct {
	Name       string
	PeriodType ValueType
	SampleType ValueType
	Timestamp  int64
	Duration   int64
	Period     int64
}

func MetaFromPprof added in v0.8.0

func MetaFromPprof(p *pprofproto.Profile, name string, sampleIndex int) Meta

type NormalizedProfile added in v0.12.0

type NormalizedProfile struct {
	Samples []*NormalizedSample
	Meta    Meta
}

type NormalizedSample added in v0.12.0

type NormalizedSample struct {
	StacktraceID string
	Value        int64
	DiffValue    int64
	Label        map[string]string
	NumLabel     map[string]int64
}

type NumLabel added in v0.12.0

type NumLabel struct {
	Name  string
	Value int64
}

type OldProfile added in v0.19.0

type OldProfile struct {
	Meta    Meta
	Samples []*SymbolizedSample
}

type Profile added in v0.9.0

type Profile struct {
	Samples []arrow.Record
	Meta    Meta
}

type Reader added in v0.19.0

type Reader struct {
	Profile       Profile
	RecordReaders []*RecordReader
}

func NewReader added in v0.19.0

func NewReader(p Profile) Reader

type RecordReader added in v0.19.0

type RecordReader struct {
	Record arrow.Record

	LabelFields  []arrow.Field
	LabelColumns []LabelColumn

	Locations                     *array.List
	Location                      *array.Struct
	Address                       *array.Uint64
	MappingStart                  *array.Uint64
	MappingLimit                  *array.Uint64
	MappingOffset                 *array.Uint64
	MappingFileIndices            *array.Uint32
	MappingFileDict               *array.Binary
	MappingBuildIDIndices         *array.Uint32
	MappingBuildIDDict            *array.Binary
	Lines                         *array.List
	Line                          *array.Struct
	LineNumber                    *array.Int64
	LineFunctionNameIndices       *array.Uint32
	LineFunctionNameDict          *array.Binary
	LineFunctionSystemNameIndices *array.Uint32
	LineFunctionSystemNameDict    *array.Binary
	LineFunctionFilenameIndices   *array.Uint32
	LineFunctionFilenameDict      *array.Binary
	LineFunctionStartLine         *array.Int64

	Value *array.Int64
	Diff  *array.Int64
}

func NewRecordReader added in v0.19.0

func NewRecordReader(ar arrow.Record) *RecordReader

type SymbolizedSample added in v0.12.0

type SymbolizedSample struct {
	Locations []*Location
	Value     int64
	DiffValue int64
	Label     map[string]string
	NumLabel  map[string]int64
}

type ValueType

type ValueType struct {
	Type string
	Unit string
}

type Writer added in v0.19.0

type Writer struct {
	RecordBuilder      *array.RecordBuilder
	LabelBuildersMap   map[string]*array.BinaryDictionaryBuilder
	LabelBuilders      []*array.BinaryDictionaryBuilder
	LocationsList      *array.ListBuilder
	Locations          *array.StructBuilder
	Addresses          *array.Uint64Builder
	MappingStart       *array.Uint64Builder
	MappingLimit       *array.Uint64Builder
	MappingOffset      *array.Uint64Builder
	MappingFile        *array.BinaryDictionaryBuilder
	MappingBuildID     *array.BinaryDictionaryBuilder
	Lines              *array.ListBuilder
	Line               *array.StructBuilder
	LineNumber         *array.Int64Builder
	FunctionName       *array.BinaryDictionaryBuilder
	FunctionSystemName *array.BinaryDictionaryBuilder
	FunctionFilename   *array.BinaryDictionaryBuilder
	FunctionStartLine  *array.Int64Builder
	Value              *array.Int64Builder
	Diff               *array.Int64Builder
}

func NewWriter added in v0.19.0

func NewWriter(pool memory.Allocator, labelNames []string) Writer

Jump to

Keyboard shortcuts

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