parcacol

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 37 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ColumnDurationSum = "sum(" + ColumnDuration + ")"
	ColumnPeriodSum   = "sum(" + ColumnPeriod + ")"
	ColumnValueCount  = "count(" + ColumnValue + ")"
	ColumnValueSum    = "sum(" + ColumnValue + ")"
)
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"
)
View Source
const (
	UnsymolizableLocationAddress = 0x0
)

Variables

View Source
var ErrMissingNameLabel = errors.New("missing __name__ label")
View Source
var ExperimentalArrow bool

Functions

func BinaryFieldFromRecord added in v0.13.0

func BinaryFieldFromRecord(ar arrow.Record, name string) (*array.Binary, error)

func BooleanFieldFromRecord added in v0.13.0

func BooleanFieldFromRecord(ar arrow.Record, name string) (*array.Boolean, error)

func DictionaryFromRecord added in v0.16.0

func DictionaryFromRecord(ar arrow.Record, name string) (*array.Dictionary, error)

func LabelNamesFromSamples added in v0.15.0

func LabelNamesFromSamples(
	takenLabels map[string]string,
	stringTable []string,
	samples []*pprofpb.Sample,
	allLabels map[string]struct{},
	allNumLabels map[string]struct{},
)

func LabelsFromSample added in v0.15.0

func LabelsFromSample(takenLabelNames map[string]string, stringTable []string, plabels []*pprofpb.Label) (map[string]string, map[string]int64)

TODO: support num label units.

func MatcherToBooleanExpression added in v0.13.0

func MatcherToBooleanExpression(matcher *labels.Matcher) (logicalplan.Expr, error)

func MatchersToBooleanExpressions added in v0.13.0

func MatchersToBooleanExpressions(matchers []*labels.Matcher) ([]logicalplan.Expr, error)

func SampleToParquetRow added in v0.12.0

func SampleToParquetRow(
	schema *dynparquet.Schema,
	row parquet.Row,
	labelNames, profileLabelNames, profileNumLabelNames []string,
	lset map[string]string,
	meta profile.Meta,
	s *profile.NormalizedSample,
) parquet.Row

SampleToParquetRow converts a sample to a Parquet row. The passed labels must be sorted.

func Schema

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

func SeriesToArrowRecord added in v0.16.0

func SeriesToArrowRecord(
	schema *dynparquet.Schema,
	series []Series,
	labelNames, profileLabelNames, profileNumLabelNames []string,
) (arrow.Record, error)

func StringValueFromDictionary added in v0.16.0

func StringValueFromDictionary(arr *array.Dictionary, i int) string

func ValidatePprofProfile added in v0.15.0

func ValidatePprofProfile(p *pprofpb.Profile) error

Types

type ArrowToProfileConverter added in v0.13.0

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

func NewArrowToProfileConverter added in v0.13.0

func NewArrowToProfileConverter(
	tracer trace.Tracer,
	m pb.MetastoreServiceClient,
) *ArrowToProfileConverter

func (*ArrowToProfileConverter) Convert added in v0.13.0

func (c *ArrowToProfileConverter) Convert(
	ctx context.Context,
	ar arrow.Record,
	valueColumnName string,
	meta profile.Meta,
) (*profile.Profile, error)

func (*ArrowToProfileConverter) SymbolizeNormalizedProfile added in v0.13.0

func (c *ArrowToProfileConverter) SymbolizeNormalizedProfile(ctx context.Context, p *profile.NormalizedProfile) (*profile.Profile, error)

type Engine added in v0.13.0

type Engine interface {
	ScanTable(name string) query.Builder
	ScanSchema(name string) query.Builder
}

type ErrMissingColumn added in v0.12.0

type ErrMissingColumn struct {
	Column  string
	Columns int
}

func (ErrMissingColumn) Error added in v0.12.0

func (e ErrMissingColumn) Error() string

type Ingester added in v0.12.0

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

func NewIngester added in v0.12.0

func NewIngester(
	logger log.Logger,
	table Table,
	schema *dynparquet.Schema,
	metastore metastorepb.MetastoreServiceClient,
	bufferPool *sync.Pool,
) Ingester

func (Ingester) Ingest added in v0.12.0

type MetastoreNormalizer added in v0.15.0

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

func NewNormalizer added in v0.12.0

func NewNormalizer(metastore pb.MetastoreServiceClient) *MetastoreNormalizer

func (*MetastoreNormalizer) NormalizeFunctions added in v0.15.0

func (n *MetastoreNormalizer) NormalizeFunctions(ctx context.Context, functions []*pprofpb.Function, stringTable []string) ([]*pb.Function, error)

func (*MetastoreNormalizer) NormalizeLocations added in v0.15.0

func (n *MetastoreNormalizer) NormalizeLocations(
	ctx context.Context,
	locations []*pprofpb.Location,
	mappings []mappingNormalizationInfo,
	functions []*pb.Function,
	normalizedAddress bool,
	stringTable []string,
) ([]*pb.Location, error)

func (*MetastoreNormalizer) NormalizeMappings added in v0.15.0

func (n *MetastoreNormalizer) NormalizeMappings(ctx context.Context, mappings []*pprofpb.Mapping, stringTable []string) ([]mappingNormalizationInfo, error)

func (*MetastoreNormalizer) NormalizePprof added in v0.15.0

func (n *MetastoreNormalizer) NormalizePprof(ctx context.Context, name string, takenLabelNames map[string]string, p *pprofpb.Profile, normalizedAddress bool) ([]*profile.NormalizedProfile, error)

func (*MetastoreNormalizer) NormalizeStacktraces added in v0.15.0

func (n *MetastoreNormalizer) NormalizeStacktraces(ctx context.Context, samples []*pprofpb.Sample, locations []*pb.Location) ([]*pb.Stacktrace, error)

type NormalizedIngester added in v0.15.0

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

func NewNormalizedIngester added in v0.15.0

func NewNormalizedIngester(
	logger log.Logger,
	table Table,
	schema *dynparquet.Schema,
	bufferPool *sync.Pool,
	allLabelNames []string,
	allPprofLabelNames []string,
	allPprofNumLabelNames []string,
) NormalizedIngester

func (NormalizedIngester) Ingest added in v0.15.0

func (ing NormalizedIngester) Ingest(ctx context.Context, series []Series) error

type NormalizedWriteRawRequest added in v0.15.0

type NormalizedWriteRawRequest struct {
	Series                []Series
	AllLabelNames         []string
	AllPprofLabelNames    []string
	AllPprofNumLabelNames []string
}

func NormalizeWriteRawRequest added in v0.15.0

func NormalizeWriteRawRequest(ctx context.Context, normalizer Normalizer, req *profilestorepb.WriteRawRequest) (NormalizedWriteRawRequest, error)

type Normalizer added in v0.12.0

type Normalizer interface {
	NormalizePprof(ctx context.Context, name string, takenLabelNames map[string]string, p *pprofpb.Profile, normalizedAddress bool) ([]*profile.NormalizedProfile, error)
}

type Querier added in v0.13.0

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

func NewQuerier added in v0.13.0

func NewQuerier(
	logger log.Logger,
	tracer trace.Tracer,
	engine Engine,
	tableName string,
	metastore metastorepb.MetastoreServiceClient,
) *Querier

func (*Querier) Labels added in v0.13.0

func (q *Querier) Labels(
	ctx context.Context,
	match []string,
	start, end time.Time,
) ([]string, error)

func (*Querier) ProfileTypes added in v0.13.0

func (q *Querier) ProfileTypes(
	ctx context.Context,
) ([]*pb.ProfileType, error)

func (*Querier) QueryMerge added in v0.13.0

func (q *Querier) QueryMerge(ctx context.Context, query string, start, end time.Time) (*profile.Profile, error)

func (*Querier) QueryRange added in v0.13.0

func (q *Querier) QueryRange(
	ctx context.Context,
	query string,
	startTime, endTime time.Time,
	step time.Duration,
	limit uint32,
) ([]*pb.MetricsSeries, error)

func (*Querier) QuerySingle added in v0.13.0

func (q *Querier) QuerySingle(
	ctx context.Context,
	query string,
	time time.Time,
) (*profile.Profile, error)

func (*Querier) Values added in v0.13.0

func (q *Querier) Values(
	ctx context.Context,
	labelName string,
	match []string,
	start, end time.Time,
) ([]string, error)

type QueryParts added in v0.16.0

type QueryParts struct {
	Meta     profile.Meta
	Delta    bool
	Matchers []*labels.Matcher
}

func QueryToFilterExprs added in v0.13.0

func QueryToFilterExprs(query string) (QueryParts, []logicalplan.Expr, error)

type Series added in v0.15.0

type Series struct {
	Labels  map[string]string
	Samples [][]*profile.NormalizedProfile
}

type Table

type Table interface {
	Schema() *dynparquet.Schema
	Insert(context.Context, []byte) (tx uint64, err error)
	InsertRecord(context.Context, arrow.Record) (tx uint64, err error)
}

Jump to

Keyboard shortcuts

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