storage

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultStripeSize is the default number of entries to allocate in the stripeSeries hash map.
	DefaultStripeSize = 1 << 10
)

Variables

View Source
var (
	ErrDiffPeriodTypeMismatch = errors.New("cannot diff profiles of different period type")
	ErrDiffSampleTypeMismatch = errors.New("cannot diff profiles of different sample type")
)
View Source
var (
	ErrPeriodTypeMismatch = errors.New("cannot merge profiles of different period type")
	ErrSampleTypeMismatch = errors.New("cannot merge profiles of different sample type")
)
View Source
var (
	ErrNotFound = errors.New("not found")
)
View Source
var (
	ErrOutOfOrderSample = errors.New("out of order sample")
)

Functions

func GenerateFlamegraph

func GenerateFlamegraph(
	ctx context.Context,
	tracer trace.Tracer,
	locations Locations,
	p InstantProfile,
) (*pb.Flamegraph, error)

func PostingsForMatchers

func PostingsForMatchers(ix IndexReader, ms ...*labels.Matcher) (*sroar.Bitmap, error)

PostingsForMatchers assembles a single postings iterator against the index reader based on the given matchers. The resulting postings are not ordered by series.

func ShortenFunctionName

func ShortenFunctionName(f string) string

ShortenFunctionName returns a shortened version of a function's name.

func WalkProfileTree

func WalkProfileTree(pt InstantProfileTree, f func(n InstantProfileTreeNode) error) error

Types

type Appendable

type Appendable interface {
	Appender(ctx context.Context, lset labels.Labels) (Appender, error)
}

type Appender

type Appender interface {
	Append(ctx context.Context, p *Profile) error
}

type ChunkPool

type ChunkPool interface {
	Put(chunkenc.Chunk) error
	GetXOR() chunkenc.Chunk
	GetDelta() chunkenc.Chunk
	GetRLE() chunkenc.Chunk
	GetTimestamp() *timestampChunk
}

ChunkPool stores a set of temporary chunks that may be individually saved and retrieved.

type DB

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

func OpenDB

func OpenDB(r prometheus.Registerer, tracer trace.Tracer, opts *DBOptions) *DB

func (*DB) Appender

func (db *DB) Appender(ctx context.Context, lset labels.Labels) (Appender, error)

func (*DB) Querier

func (db *DB) Querier(ctx context.Context, mint, maxt int64) Querier

func (*DB) Run

func (db *DB) Run(ctx context.Context) error

type DBOptions

type DBOptions struct {
	Retention time.Duration

	HeadExpensiveMetrics bool
}

type DiffProfile

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

func NewDiffProfile

func NewDiffProfile(base, compare InstantProfile) (*DiffProfile, error)

func (*DiffProfile) ProfileMeta

func (d *DiffProfile) ProfileMeta() InstantProfileMeta

func (*DiffProfile) ProfileTree

func (d *DiffProfile) ProfileTree() InstantProfileTree

type DiffProfileTree

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

func (*DiffProfileTree) Iterator

func (*DiffProfileTree) RootCumulativeValue added in v0.2.0

func (d *DiffProfileTree) RootCumulativeValue() int64

type DiffProfileTreeIterator

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

func (*DiffProfileTreeIterator) At

func (*DiffProfileTreeIterator) HasMore

func (i *DiffProfileTreeIterator) HasMore() bool

func (*DiffProfileTreeIterator) NextChild

func (i *DiffProfileTreeIterator) NextChild() bool

func (*DiffProfileTreeIterator) StepInto

func (i *DiffProfileTreeIterator) StepInto() bool

func (*DiffProfileTreeIterator) StepUp

func (i *DiffProfileTreeIterator) StepUp()

type FlamegraphIterator

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

func NewFlamegraphIterator

func NewFlamegraphIterator(fgRoot *pb.FlamegraphNode) *FlamegraphIterator

func (*FlamegraphIterator) At

func (*FlamegraphIterator) HasMore

func (fgi *FlamegraphIterator) HasMore() bool

func (*FlamegraphIterator) NextChild

func (fgi *FlamegraphIterator) NextChild() bool

func (*FlamegraphIterator) StepInto

func (fgi *FlamegraphIterator) StepInto() bool

func (*FlamegraphIterator) StepUp

func (fgi *FlamegraphIterator) StepUp()
type Head struct {
	// contains filtered or unexported fields
}

func NewHead

func NewHead(r prometheus.Registerer, tracer trace.Tracer, opts *HeadOptions) *Head

func (*Head) Appender

func (h *Head) Appender(ctx context.Context, lset labels.Labels) (Appender, error)

Appender returns a new Appender on the database.

func (*Head) Collect

func (h *Head) Collect(metrics chan<- prometheus.Metric)

func (*Head) Describe

func (h *Head) Describe(descs chan<- *prometheus.Desc)

func (*Head) Index

func (h *Head) Index() (IndexReader, error)

Index returns an IndexReader against the block.

func (*Head) MaxTime

func (h *Head) MaxTime() int64

MaxTime returns the highest timestamp seen in data of the head.

func (*Head) MinTime

func (h *Head) MinTime() int64

MinTime returns the lowest time bound on visible data in the head.

func (*Head) Querier

func (h *Head) Querier(ctx context.Context, mint, maxt int64) Querier

func (*Head) Truncate

func (h *Head) Truncate(mint int64) error

Truncate removes old data before mint from the head and WAL.

type HeadChunkPool

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

HeadChunkPool wraps chunkenc.Pool and adds support for timestampChunk.

func (*HeadChunkPool) GetDelta

func (p *HeadChunkPool) GetDelta() chunkenc.Chunk

func (*HeadChunkPool) GetRLE

func (p *HeadChunkPool) GetRLE() chunkenc.Chunk

func (*HeadChunkPool) GetTimestamp

func (p *HeadChunkPool) GetTimestamp() *timestampChunk

func (*HeadChunkPool) GetXOR

func (p *HeadChunkPool) GetXOR() chunkenc.Chunk

func (*HeadChunkPool) Put

func (p *HeadChunkPool) Put(c chunkenc.Chunk) error

type HeadOptions

type HeadOptions struct {
	ChunkPool        ChunkPool
	ExpensiveMetrics bool
}

type HeadQuerier

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

func (*HeadQuerier) LabelNames

func (q *HeadQuerier) LabelNames(ms ...*labels.Matcher) ([]string, Warnings, error)

func (*HeadQuerier) LabelValues

func (q *HeadQuerier) LabelValues(name string, ms ...*labels.Matcher) ([]string, Warnings, error)

func (*HeadQuerier) Select

func (q *HeadQuerier) Select(hints *SelectHints, ms ...*labels.Matcher) SeriesSet

type IndexReader

type IndexReader interface {
	// Postings returns the postings sroar.Bitmap.
	Postings(name string, values ...string) (*sroar.Bitmap, error)

	// LabelValues returns possible label values which may not be sorted.
	LabelValues(name string, matchers ...*labels.Matcher) ([]string, error)

	// LabelValueFor returns label value for the given label name in the series referred to by ID.
	// If the series couldn't be found or the series doesn't have the requested label a
	// ErrNotFound is returned as error.
	LabelValueFor(id uint64, label string) (string, error)

	// LabelNames returns possible label names which may not be sorted.
	LabelNames(matchers ...*labels.Matcher) ([]string, error)

	// LabelNamesFor returns label names for the given series referred to by IDs.
	LabelNamesFor(ids ...uint64) ([]string, error)

	// Close releases the underlying resource of the reader.
	Close() error
}

IndexReader provides reading access of serialized index data.

type InstantProfile

type InstantProfile interface {
	ProfileTree() InstantProfileTree
	ProfileMeta() InstantProfileMeta
}

func MergeProfiles

func MergeProfiles(profiles ...InstantProfile) (InstantProfile, error)

func MergeProfilesConcurrent

func MergeProfilesConcurrent(
	tracer trace.Tracer,
	ctx context.Context,
	profileCh chan InstantProfile,
	concurrency int,
	producerFunc func() error,
) (InstantProfile, error)

func MergeSeriesSetProfiles

func MergeSeriesSetProfiles(tracer trace.Tracer, ctx context.Context, set SeriesSet) (InstantProfile, error)

func NewMergeProfile

func NewMergeProfile(a, b InstantProfile) (InstantProfile, error)

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 ProfileMetaFromPprof

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

type InstantProfileTree

type InstantProfileTree interface {
	RootCumulativeValue() int64
	Iterator() InstantProfileTreeIterator
}

type InstantProfileTreeIterator

type InstantProfileTreeIterator interface {
	HasMore() bool
	NextChild() bool
	At() InstantProfileTreeNode
	StepInto() bool
	StepUp()
}

type InstantProfileTreeNode

type InstantProfileTreeNode interface {
	LocationID() uint64
	FlatValues() []*ProfileTreeValueNode
	FlatDiffValues() []*ProfileTreeValueNode
}

func DiffInstantProfileTreeNodes

func DiffInstantProfileTreeNodes(base, compare InstantProfileTreeNode) InstantProfileTreeNode

func MergeInstantProfileTreeNodes

func MergeInstantProfileTreeNodes(a, b InstantProfileTreeNode) InstantProfileTreeNode

type InstantProfileTreeStack

type InstantProfileTreeStack []*InstantProfileTreeStackItem

func (*InstantProfileTreeStack) IsEmpty

func (s *InstantProfileTreeStack) IsEmpty() bool

func (*InstantProfileTreeStack) Peek

func (*InstantProfileTreeStack) Pop

func (*InstantProfileTreeStack) Push

func (*InstantProfileTreeStack) Size

func (s *InstantProfileTreeStack) Size() int

type InstantProfileTreeStackItem

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

type LabelQuerier

type LabelQuerier interface {
	// LabelValues returns all potential values for a label name.
	// It is not safe to use the strings beyond the lifetime of the querier.
	// If matchers are specified the returned result set is reduced
	// to label values of metrics matching the matchers.
	LabelValues(name string, matchers ...*labels.Matcher) ([]string, Warnings, error)

	// LabelNames returns all the unique label names present in the block in sorted order.
	// If matchers are specified the returned result set is reduced
	// to label names of metrics matching the matchers.
	LabelNames(matchers ...*labels.Matcher) ([]string, Warnings, error)
}

LabelQuerier provides querying access over labels.

type Labels

type Labels interface {
	// Labels returns the complete set of labels. For series it means all labels identifying the series.
	Labels() labels.Labels
}

Labels represents an item that has labels e.g. time series.

type LocationStack

type LocationStack []*profile.Location

func (*LocationStack) IsEmpty

func (s *LocationStack) IsEmpty() bool

func (*LocationStack) Peek

func (s *LocationStack) Peek() *profile.Location

func (*LocationStack) Pop

func (s *LocationStack) Pop() (*profile.Location, bool)

func (*LocationStack) Push

func (s *LocationStack) Push(e *profile.Location)

func (*LocationStack) Size

func (s *LocationStack) Size() int

func (*LocationStack) ToLocationStacktrace

func (s *LocationStack) ToLocationStacktrace() []*profile.Location

type Locations

type Locations interface {
	GetLocationsByIDs(ctx context.Context, id ...uint64) (map[uint64]*profile.Location, error)
}

type MemMergeSeries

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

MemMergeSeries is an iterator that sums up all values while iterating that are within the range. In the end it returns a slice iterator with only the merge profile in it.

func (*MemMergeSeries) Iterator

func (ms *MemMergeSeries) Iterator() ProfileSeriesIterator

func (*MemMergeSeries) Labels

func (ms *MemMergeSeries) Labels() labels.Labels

type MemRangeSeries

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

MemRangeSeries is an iterator that only queries certain chunks within the range and then only the samples within the range.

func (*MemRangeSeries) Iterator

func (rs *MemRangeSeries) Iterator() ProfileSeriesIterator

func (*MemRangeSeries) Labels

func (rs *MemRangeSeries) Labels() labels.Labels

type MemRangeSeriesIterator

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

func (*MemRangeSeriesIterator) At

func (*MemRangeSeriesIterator) Err

func (it *MemRangeSeriesIterator) Err() error

func (*MemRangeSeriesIterator) Next

func (it *MemRangeSeriesIterator) Next() bool

type MemRootSeries

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

MemRootSeries is an iterator that only queries the cumulative values for the root of each series.

func (*MemRootSeries) Iterator

func (rs *MemRootSeries) Iterator() ProfileSeriesIterator

func (*MemRootSeries) Labels

func (rs *MemRootSeries) Labels() labels.Labels

type MemRootSeriesIterator added in v0.2.0

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

func (*MemRootSeriesIterator) At added in v0.2.0

func (*MemRootSeriesIterator) Err added in v0.2.0

func (it *MemRootSeriesIterator) Err() error

func (*MemRootSeriesIterator) Next added in v0.2.0

func (it *MemRootSeriesIterator) Next() bool

type MemSeries

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

func NewMemSeries

func NewMemSeries(id uint64, lset labels.Labels, updateMaxTime func(int64), chunkPool ChunkPool) *MemSeries

func (*MemSeries) Appender

func (s *MemSeries) Appender() (*MemSeriesAppender, error)

func (*MemSeries) Iterator

func (s *MemSeries) Iterator() ProfileSeriesIterator

func (*MemSeries) Labels

func (s *MemSeries) Labels() labels.Labels

type MemSeriesAppender

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

func (*MemSeriesAppender) Append

func (a *MemSeriesAppender) Append(ctx context.Context, p *Profile) error

type MemSeriesInstantProfile

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

func (*MemSeriesInstantProfile) ProfileMeta

func (*MemSeriesInstantProfile) ProfileTree

type MemSeriesInstantProfileTree

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

func (*MemSeriesInstantProfileTree) Iterator

func (*MemSeriesInstantProfileTree) RootCumulativeValue added in v0.2.0

func (t *MemSeriesInstantProfileTree) RootCumulativeValue() int64

type MemSeriesIterator

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

func (*MemSeriesIterator) At

func (*MemSeriesIterator) Err

func (it *MemSeriesIterator) Err() error

func (*MemSeriesIterator) Next

func (it *MemSeriesIterator) Next() bool

type MemSeriesIteratorTree

type MemSeriesIteratorTree struct {
	Roots *MemSeriesIteratorTreeNode
}

type MemSeriesIteratorTreeIterator

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

func (*MemSeriesIteratorTreeIterator) At

func (*MemSeriesIteratorTreeIterator) HasMore

func (i *MemSeriesIteratorTreeIterator) HasMore() bool

func (*MemSeriesIteratorTreeIterator) NextChild

func (i *MemSeriesIteratorTreeIterator) NextChild() bool

func (*MemSeriesIteratorTreeIterator) StepInto

func (i *MemSeriesIteratorTreeIterator) StepInto() bool

func (*MemSeriesIteratorTreeIterator) StepUp

func (i *MemSeriesIteratorTreeIterator) StepUp()

type MemSeriesIteratorTreeNode

type MemSeriesIteratorTreeNode struct {
	Children []*MemSeriesIteratorTreeNode
	// contains filtered or unexported fields
}

func (*MemSeriesIteratorTreeNode) CumulativeDiffValue

func (n *MemSeriesIteratorTreeNode) CumulativeDiffValue() int64

func (*MemSeriesIteratorTreeNode) CumulativeDiffValues

func (n *MemSeriesIteratorTreeNode) CumulativeDiffValues() []*ProfileTreeValueNode

func (*MemSeriesIteratorTreeNode) CumulativeValue

func (n *MemSeriesIteratorTreeNode) CumulativeValue() int64

func (*MemSeriesIteratorTreeNode) CumulativeValues

func (n *MemSeriesIteratorTreeNode) CumulativeValues() []*ProfileTreeValueNode

func (*MemSeriesIteratorTreeNode) FlatDiffValues

func (n *MemSeriesIteratorTreeNode) FlatDiffValues() []*ProfileTreeValueNode

func (*MemSeriesIteratorTreeNode) FlatValues

func (*MemSeriesIteratorTreeNode) LocationID

func (n *MemSeriesIteratorTreeNode) LocationID() uint64

type MemSeriesIteratorTreeStack

type MemSeriesIteratorTreeStack []*MemSeriesIteratorTreeStackEntry

func (*MemSeriesIteratorTreeStack) IsEmpty

func (s *MemSeriesIteratorTreeStack) IsEmpty() bool

func (*MemSeriesIteratorTreeStack) Peek

func (*MemSeriesIteratorTreeStack) Pop

func (*MemSeriesIteratorTreeStack) Push

func (*MemSeriesIteratorTreeStack) Size

func (s *MemSeriesIteratorTreeStack) Size() int

type MemSeriesIteratorTreeStackEntry

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

type MemSeriesIteratorTreeValueNode

type MemSeriesIteratorTreeValueNode struct {
	Values   MemSeriesValuesIterator
	Label    map[string][]string
	NumLabel map[string][]int64
	NumUnit  map[string][]string
}

type MemSeriesStats

type MemSeriesStats struct {
	Flat []MemSeriesValueStats
	// contains filtered or unexported fields
}

type MemSeriesTree

type MemSeriesTree struct {
	Roots *MemSeriesTreeNode
	// contains filtered or unexported fields
}

func (*MemSeriesTree) Insert

func (t *MemSeriesTree) Insert(index uint16, profileTree *ProfileTree) error

func (*MemSeriesTree) Iterator

func (t *MemSeriesTree) Iterator() *MemSeriesTreeIterator

type MemSeriesTreeIterator

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

func NewMemSeriesTreeIterator

func NewMemSeriesTreeIterator(t *MemSeriesTree) *MemSeriesTreeIterator

func (*MemSeriesTreeIterator) At

func (*MemSeriesTreeIterator) ChildIndex

func (i *MemSeriesTreeIterator) ChildIndex() int

func (*MemSeriesTreeIterator) HasMore

func (i *MemSeriesTreeIterator) HasMore() bool

func (*MemSeriesTreeIterator) NextChild

func (i *MemSeriesTreeIterator) NextChild() bool

func (*MemSeriesTreeIterator) Node

func (*MemSeriesTreeIterator) StepInto

func (i *MemSeriesTreeIterator) StepInto() bool

func (*MemSeriesTreeIterator) StepUp

func (i *MemSeriesTreeIterator) StepUp()

type MemSeriesTreeNode

type MemSeriesTreeNode struct {
	LocationID uint64
	Children   []*MemSeriesTreeNode
	// contains filtered or unexported fields
}

type MemSeriesTreeStack

type MemSeriesTreeStack []*MemSeriesTreeStackEntry

func (*MemSeriesTreeStack) IsEmpty

func (s *MemSeriesTreeStack) IsEmpty() bool

func (*MemSeriesTreeStack) Peek

func (*MemSeriesTreeStack) Pop

func (*MemSeriesTreeStack) Push

func (*MemSeriesTreeStack) Size

func (s *MemSeriesTreeStack) Size() int

type MemSeriesTreeStackEntry

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

type MemSeriesValueStats

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

type MemSeriesValuesIterator

type MemSeriesValuesIterator interface {
	// Next iterates to the next value and returns true if there's more.
	Next() bool
	// At returns the current value.
	At() int64
	// Err returns the underlying errors. Next will return false when encountering errors.
	Err() error
	// Read returns how many iterations the iterator has read at any given moment.
	Read() uint64
}

MemSeriesValuesIterator is an abstraction on iterator over values from possible multiple chunks. It most likely is an abstraction like the MultiChunksIterator over []chunkenc.Chunk.

type MergeProfile

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

func (*MergeProfile) ProfileMeta

func (m *MergeProfile) ProfileMeta() InstantProfileMeta

func (*MergeProfile) ProfileTree

func (m *MergeProfile) ProfileTree() InstantProfileTree

type MergeProfileTree

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

func (*MergeProfileTree) Iterator

func (*MergeProfileTree) RootCumulativeValue added in v0.2.0

func (m *MergeProfileTree) RootCumulativeValue() int64

type MergeProfileTreeIterator

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

func (*MergeProfileTreeIterator) At

func (*MergeProfileTreeIterator) HasMore

func (i *MergeProfileTreeIterator) HasMore() bool

func (*MergeProfileTreeIterator) NextChild

func (i *MergeProfileTreeIterator) NextChild() bool

func (*MergeProfileTreeIterator) StepInto

func (i *MergeProfileTreeIterator) StepInto() bool

func (*MergeProfileTreeIterator) StepUp

func (i *MergeProfileTreeIterator) StepUp()

type MultiChunksIterator

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

MultiChunksIterator iterates over multiple chunkenc.Chunk until the last value was read, then it'll return 0 for sparseness. MultiChunksIterator implements the MemSeriesValuesIterator.

func NewMultiChunkIterator

func NewMultiChunkIterator(chunks []chunkenc.Chunk) *MultiChunksIterator

func (*MultiChunksIterator) At

func (it *MultiChunksIterator) At() int64

func (*MultiChunksIterator) Err

func (it *MultiChunksIterator) Err() error

func (*MultiChunksIterator) Next

func (it *MultiChunksIterator) Next() bool

func (*MultiChunksIterator) Read

func (it *MultiChunksIterator) Read() uint64

func (*MultiChunksIterator) Reset

func (it *MultiChunksIterator) Reset(chunks []chunkenc.Chunk)

func (*MultiChunksIterator) Seek

func (it *MultiChunksIterator) Seek(index uint64) bool

Seek implements seeking to the given index. This is an important divergence from the underlying chunkenc.Iterator interface, as we take am uint64 as index instead of an uint16, in case we ever happen to iterate over more than ~500 chunks.

type Profile

type Profile struct {
	Tree *ProfileTree
	Meta InstantProfileMeta
}

func CopyInstantProfile

func CopyInstantProfile(p InstantProfile) *Profile

func ProfileFromPprof

func ProfileFromPprof(ctx context.Context, l log.Logger, s metastore.ProfileMetaStore, p *profile.Profile, sampleIndex int) (*Profile, error)

func ProfilesFromPprof

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

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

func (*Profile) ProfileMeta

func (p *Profile) ProfileMeta() InstantProfileMeta

func (*Profile) ProfileTree

func (p *Profile) ProfileTree() InstantProfileTree

type ProfileSeries

type ProfileSeries interface {
	Iterator() ProfileSeriesIterator
}

type ProfileSeriesIterator

type ProfileSeriesIterator interface {
	Next() bool
	At() InstantProfile
	Err() error
}

type ProfileTree

type ProfileTree struct {
	Roots *ProfileTreeRootNode
}

func CopyInstantProfileTree

func CopyInstantProfileTree(pt InstantProfileTree) *ProfileTree

func NewProfileTree

func NewProfileTree() *ProfileTree

func ProfileTreeFromPprof

func ProfileTreeFromPprof(ctx context.Context, l log.Logger, s metastore.ProfileMetaStore, p *profile.Profile, sampleIndex int) (*ProfileTree, error)

func (*ProfileTree) Insert

func (t *ProfileTree) Insert(sample *profile.Sample)

func (*ProfileTree) Iterator

func (*ProfileTree) RootCumulativeValue added in v0.2.0

func (t *ProfileTree) RootCumulativeValue() int64

type ProfileTreeIterator

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

func NewProfileTreeIterator

func NewProfileTreeIterator(t *ProfileTree) *ProfileTreeIterator

func (*ProfileTreeIterator) At

func (*ProfileTreeIterator) HasMore

func (i *ProfileTreeIterator) HasMore() bool

func (*ProfileTreeIterator) NextChild

func (i *ProfileTreeIterator) NextChild() bool

func (*ProfileTreeIterator) StepInto

func (i *ProfileTreeIterator) StepInto() bool

func (*ProfileTreeIterator) StepUp

func (i *ProfileTreeIterator) StepUp()

type ProfileTreeNode

type ProfileTreeNode struct {
	Children []*ProfileTreeNode
	// contains filtered or unexported fields
}

func (*ProfileTreeNode) FlatDiffValues

func (n *ProfileTreeNode) FlatDiffValues() []*ProfileTreeValueNode

func (*ProfileTreeNode) FlatValues

func (n *ProfileTreeNode) FlatValues() []*ProfileTreeValueNode

func (*ProfileTreeNode) LocationID

func (n *ProfileTreeNode) LocationID() uint64

type ProfileTreeRootNode added in v0.2.0

type ProfileTreeRootNode struct {
	CumulativeValue int64
	*ProfileTreeNode
}

ProfileTreeRootNode is just like a ProfileTreeNode except it can additionally hold the cumulative value of the root as an optimization.

type ProfileTreeStack

type ProfileTreeStack []*ProfileTreeStackEntry

func (*ProfileTreeStack) IsEmpty

func (s *ProfileTreeStack) IsEmpty() bool

func (*ProfileTreeStack) Peek

func (*ProfileTreeStack) Pop

func (*ProfileTreeStack) Push

func (*ProfileTreeStack) Size

func (s *ProfileTreeStack) Size() int

type ProfileTreeStackEntry

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

type ProfileTreeValueNode

type ProfileTreeValueNode struct {
	Value    int64
	Label    map[string][]string
	NumLabel map[string][]int64
	NumUnit  map[string][]string
	// contains filtered or unexported fields
}

func (*ProfileTreeValueNode) Key

func (n *ProfileTreeValueNode) Key(locationIDs ...uint64)

type ProfileTreeValueNodeKey

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

func (*ProfileTreeValueNodeKey) Equals

type Querier

type Querier interface {
	LabelQuerier
	Select(hints *SelectHints, ms ...*labels.Matcher) SeriesSet
}

type Queryable

type Queryable interface {
	Querier(ctx context.Context, mint, maxt int64) Querier
}

type ScaledInstantProfile

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

func (*ScaledInstantProfile) ProfileMeta

func (p *ScaledInstantProfile) ProfileMeta() InstantProfileMeta

func (*ScaledInstantProfile) ProfileTree

func (p *ScaledInstantProfile) ProfileTree() InstantProfileTree

type ScaledInstantProfileTree

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

func (*ScaledInstantProfileTree) Iterator

func (*ScaledInstantProfileTree) RootCumulativeValue added in v0.2.0

func (t *ScaledInstantProfileTree) RootCumulativeValue() int64

type ScaledInstantProfileTreeIterator

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

func (*ScaledInstantProfileTreeIterator) At

func (*ScaledInstantProfileTreeIterator) HasMore

func (*ScaledInstantProfileTreeIterator) NextChild

func (i *ScaledInstantProfileTreeIterator) NextChild() bool

func (*ScaledInstantProfileTreeIterator) StepInto

func (i *ScaledInstantProfileTreeIterator) StepInto() bool

func (*ScaledInstantProfileTreeIterator) StepUp

type SelectHints

type SelectHints struct {
	Start int64 // Start time in milliseconds for this select.
	End   int64 // End time in milliseconds for this select.

	Merge    bool // Is the query result a merge of all samples?
	Root     bool // Is the query result supposed to only contain the root's cumulative values?
	Metadata bool // Is the database just being queried for metadata like label-names/label-values.
}

type Series

type Series interface {
	Labels
	ProfileSeries
}

type SeriesSet

type SeriesSet interface {
	Next() bool
	// At returns full series. Returned series should be iterable even after Next is called.
	At() Series
	// The error that iteration as failed with.
	// When an error occurs, set cannot continue to iterate.
	Err() error
	// A collection of warnings for the whole set.
	// Warnings could be return even iteration has not failed with error.
	Warnings() Warnings
}

SeriesSet contains a set of series.

type SliceProfileSeriesIterator

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

func (*SliceProfileSeriesIterator) At

func (*SliceProfileSeriesIterator) Err

func (*SliceProfileSeriesIterator) Next

func (i *SliceProfileSeriesIterator) Next() bool

type SliceSeriesSet

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

func (*SliceSeriesSet) At

func (s *SliceSeriesSet) At() Series

func (*SliceSeriesSet) Err

func (s *SliceSeriesSet) Err() error

func (*SliceSeriesSet) Next

func (s *SliceSeriesSet) Next() bool

func (*SliceSeriesSet) Warnings

func (s *SliceSeriesSet) Warnings() Warnings

type TreeStack

type TreeStack []*TreeStackEntry

func (*TreeStack) IsEmpty

func (s *TreeStack) IsEmpty() bool

func (*TreeStack) Peek

func (s *TreeStack) Peek() *TreeStackEntry

func (*TreeStack) Pop

func (s *TreeStack) Pop() (*TreeStackEntry, bool)

func (*TreeStack) Push

func (s *TreeStack) Push(e *TreeStackEntry)

func (*TreeStack) Size

func (s *TreeStack) Size() int

type TreeStackEntry

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

type ValueType

type ValueType struct {
	Type string
	Unit string
}

type Warnings

type Warnings []error

func (Warnings) ToStrings

func (w Warnings) ToStrings() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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