Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateFlamegraph(ctx context.Context, tracer trace.Tracer, locations Locations, ...) (*pb.Flamegraph, error)
- func PostingsForMatchers(ix IndexReader, ms ...*labels.Matcher) (*sroar.Bitmap, error)
- func ShortenFunctionName(f string) string
- func WalkProfileTree(pt InstantProfileTree, f func(n InstantProfileTreeNode) error) error
- type Appendable
- type Appender
- type ChunkPool
- type DB
- type DBOptions
- type DiffProfile
- type DiffProfileTree
- type DiffProfileTreeIterator
- type FlamegraphIterator
- type Head
- func (h *Head) Appender(ctx context.Context, lset labels.Labels) (Appender, error)
- func (h *Head) Collect(metrics chan<- prometheus.Metric)
- func (h *Head) Describe(descs chan<- *prometheus.Desc)
- func (h *Head) Index() (IndexReader, error)
- func (h *Head) MaxTime() int64
- func (h *Head) MinTime() int64
- func (h *Head) Querier(ctx context.Context, mint, maxt int64) Querier
- func (h *Head) Truncate(mint int64) error
- type HeadChunkPool
- type HeadOptions
- type HeadQuerier
- type IndexReader
- type InstantProfile
- func MergeProfiles(profiles ...InstantProfile) (InstantProfile, error)
- func MergeProfilesConcurrent(tracer trace.Tracer, ctx context.Context, profileCh chan InstantProfile, ...) (InstantProfile, error)
- func MergeSeriesSetProfiles(tracer trace.Tracer, ctx context.Context, set SeriesSet) (InstantProfile, error)
- func NewMergeProfile(a, b InstantProfile) (InstantProfile, error)
- func NewScaledInstantProfile(p InstantProfile, ratio float64) InstantProfile
- type InstantProfileMeta
- type InstantProfileTree
- type InstantProfileTreeIterator
- type InstantProfileTreeNode
- type InstantProfileTreeStack
- func (s *InstantProfileTreeStack) IsEmpty() bool
- func (s *InstantProfileTreeStack) Peek() *InstantProfileTreeStackItem
- func (s *InstantProfileTreeStack) Pop() (*InstantProfileTreeStackItem, bool)
- func (s *InstantProfileTreeStack) Push(e *InstantProfileTreeStackItem)
- func (s *InstantProfileTreeStack) Size() int
- type InstantProfileTreeStackItem
- type LabelQuerier
- type Labels
- type LocationStack
- type Locations
- type MemMergeSeries
- type MemRangeSeries
- type MemRangeSeriesIterator
- type MemRootSeries
- type MemRootSeriesIterator
- type MemSeries
- type MemSeriesAppender
- type MemSeriesInstantProfile
- type MemSeriesInstantProfileTree
- type MemSeriesIterator
- type MemSeriesIteratorTree
- type MemSeriesIteratorTreeIterator
- type MemSeriesIteratorTreeNode
- func (n *MemSeriesIteratorTreeNode) CumulativeDiffValue() int64
- func (n *MemSeriesIteratorTreeNode) CumulativeDiffValues() []*ProfileTreeValueNode
- func (n *MemSeriesIteratorTreeNode) CumulativeValue() int64
- func (n *MemSeriesIteratorTreeNode) CumulativeValues() []*ProfileTreeValueNode
- func (n *MemSeriesIteratorTreeNode) FlatDiffValues() []*ProfileTreeValueNode
- func (n *MemSeriesIteratorTreeNode) FlatValues() []*ProfileTreeValueNode
- func (n *MemSeriesIteratorTreeNode) LocationID() uint64
- type MemSeriesIteratorTreeStack
- func (s *MemSeriesIteratorTreeStack) IsEmpty() bool
- func (s *MemSeriesIteratorTreeStack) Peek() *MemSeriesIteratorTreeStackEntry
- func (s *MemSeriesIteratorTreeStack) Pop() (*MemSeriesIteratorTreeStackEntry, bool)
- func (s *MemSeriesIteratorTreeStack) Push(e *MemSeriesIteratorTreeStackEntry)
- func (s *MemSeriesIteratorTreeStack) Size() int
- type MemSeriesIteratorTreeStackEntry
- type MemSeriesIteratorTreeValueNode
- type MemSeriesStats
- type MemSeriesTree
- type MemSeriesTreeIterator
- func (i *MemSeriesTreeIterator) At() *MemSeriesTreeNode
- func (i *MemSeriesTreeIterator) ChildIndex() int
- func (i *MemSeriesTreeIterator) HasMore() bool
- func (i *MemSeriesTreeIterator) NextChild() bool
- func (i *MemSeriesTreeIterator) Node() *MemSeriesTreeNode
- func (i *MemSeriesTreeIterator) StepInto() bool
- func (i *MemSeriesTreeIterator) StepUp()
- type MemSeriesTreeNode
- type MemSeriesTreeStack
- type MemSeriesTreeStackEntry
- type MemSeriesValueStats
- type MemSeriesValuesIterator
- type MergeProfile
- type MergeProfileTree
- type MergeProfileTreeIterator
- type MultiChunksIterator
- type Profile
- type ProfileSeries
- type ProfileSeriesIterator
- type ProfileTree
- type ProfileTreeIterator
- type ProfileTreeNode
- type ProfileTreeRootNode
- type ProfileTreeStack
- type ProfileTreeStackEntry
- type ProfileTreeValueNode
- type ProfileTreeValueNodeKey
- type Querier
- type Queryable
- type ScaledInstantProfile
- type ScaledInstantProfileTree
- type ScaledInstantProfileTreeIterator
- type SelectHints
- type Series
- type SeriesSet
- type SliceProfileSeriesIterator
- type SliceSeriesSet
- type TreeStack
- type TreeStackEntry
- type ValueType
- type Warnings
Constants ¶
const (
// DefaultStripeSize is the default number of entries to allocate in the stripeSeries hash map.
DefaultStripeSize = 1 << 10
)
Variables ¶
var ( ErrDiffPeriodTypeMismatch = errors.New("cannot diff profiles of different period type") ErrDiffSampleTypeMismatch = errors.New("cannot diff profiles of different sample type") )
var ( ErrPeriodTypeMismatch = errors.New("cannot merge profiles of different period type") ErrSampleTypeMismatch = errors.New("cannot merge profiles of different sample type") )
var (
ErrNotFound = errors.New("not found")
)
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 ¶
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 ¶
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 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
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 (d *DiffProfileTree) Iterator() InstantProfileTreeIterator
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 (i *DiffProfileTreeIterator) At() InstantProfileTreeNode
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 (fgi *FlamegraphIterator) At() *pb.FlamegraphNode
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 ¶
type Head struct {
// contains filtered or unexported fields
}
func NewHead ¶
func NewHead(r prometheus.Registerer, tracer trace.Tracer, opts *HeadOptions) *Head
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.
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
type HeadOptions ¶
type HeadQuerier ¶
type HeadQuerier struct {
// contains filtered or unexported fields
}
func (*HeadQuerier) LabelNames ¶
func (*HeadQuerier) LabelValues ¶
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 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 (s *InstantProfileTreeStack) Peek() *InstantProfileTreeStackItem
func (*InstantProfileTreeStack) Pop ¶
func (s *InstantProfileTreeStack) Pop() (*InstantProfileTreeStackItem, bool)
func (*InstantProfileTreeStack) Push ¶
func (s *InstantProfileTreeStack) Push(e *InstantProfileTreeStackItem)
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 ¶
func (*LocationStack) IsEmpty ¶
func (s *LocationStack) IsEmpty() bool
func (*LocationStack) Peek ¶
func (s *LocationStack) Peek() *profile.Location
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 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 (it *MemRangeSeriesIterator) At() InstantProfile
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 (it *MemRootSeriesIterator) At() InstantProfile
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 (*MemSeries) Appender ¶
func (s *MemSeries) Appender() (*MemSeriesAppender, error)
func (*MemSeries) Iterator ¶
func (s *MemSeries) Iterator() ProfileSeriesIterator
type MemSeriesAppender ¶
type MemSeriesAppender struct {
// contains filtered or unexported fields
}
type MemSeriesInstantProfile ¶
type MemSeriesInstantProfile struct {
// contains filtered or unexported fields
}
func (*MemSeriesInstantProfile) ProfileMeta ¶
func (p *MemSeriesInstantProfile) ProfileMeta() InstantProfileMeta
func (*MemSeriesInstantProfile) ProfileTree ¶
func (p *MemSeriesInstantProfile) ProfileTree() InstantProfileTree
type MemSeriesInstantProfileTree ¶
type MemSeriesInstantProfileTree struct {
// contains filtered or unexported fields
}
func (*MemSeriesInstantProfileTree) Iterator ¶
func (t *MemSeriesInstantProfileTree) Iterator() InstantProfileTreeIterator
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 (it *MemSeriesIterator) At() InstantProfile
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 NewMemSeriesIteratorTreeIterator ¶
func NewMemSeriesIteratorTreeIterator(t *MemSeriesIteratorTree) *MemSeriesIteratorTreeIterator
func (*MemSeriesIteratorTreeIterator) At ¶
func (i *MemSeriesIteratorTreeIterator) At() InstantProfileTreeNode
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 (n *MemSeriesIteratorTreeNode) FlatValues() []*ProfileTreeValueNode
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 (s *MemSeriesIteratorTreeStack) Peek() *MemSeriesIteratorTreeStackEntry
func (*MemSeriesIteratorTreeStack) Pop ¶
func (s *MemSeriesIteratorTreeStack) Pop() (*MemSeriesIteratorTreeStackEntry, bool)
func (*MemSeriesIteratorTreeStack) Push ¶
func (s *MemSeriesIteratorTreeStack) Push(e *MemSeriesIteratorTreeStackEntry)
func (*MemSeriesIteratorTreeStack) Size ¶
func (s *MemSeriesIteratorTreeStack) Size() int
type MemSeriesIteratorTreeStackEntry ¶
type MemSeriesIteratorTreeStackEntry struct {
// contains filtered or unexported fields
}
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 (i *MemSeriesTreeIterator) At() *MemSeriesTreeNode
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 (i *MemSeriesTreeIterator) Node() *MemSeriesTreeNode
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 (s *MemSeriesTreeStack) Peek() *MemSeriesTreeStackEntry
func (*MemSeriesTreeStack) Pop ¶
func (s *MemSeriesTreeStack) Pop() (*MemSeriesTreeStackEntry, bool)
func (*MemSeriesTreeStack) Push ¶
func (s *MemSeriesTreeStack) Push(e *MemSeriesTreeStackEntry)
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 (m *MergeProfileTree) Iterator() InstantProfileTreeIterator
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 (i *MergeProfileTreeIterator) At() InstantProfileTreeNode
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 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 (*ProfileTree) Insert ¶
func (t *ProfileTree) Insert(sample *profile.Sample)
func (*ProfileTree) Iterator ¶
func (t *ProfileTree) Iterator() InstantProfileTreeIterator
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 (i *ProfileTreeIterator) At() InstantProfileTreeNode
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 (s *ProfileTreeStack) Peek() *ProfileTreeStackEntry
func (*ProfileTreeStack) Pop ¶
func (s *ProfileTreeStack) Pop() (*ProfileTreeStackEntry, bool)
func (*ProfileTreeStack) Push ¶
func (s *ProfileTreeStack) Push(e *ProfileTreeStackEntry)
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 ¶
func (k *ProfileTreeValueNodeKey) Equals(o ProfileTreeValueNodeKey) bool
type Querier ¶
type Querier interface { LabelQuerier Select(hints *SelectHints, ms ...*labels.Matcher) SeriesSet }
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 (t *ScaledInstantProfileTree) Iterator() InstantProfileTreeIterator
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 (i *ScaledInstantProfileTreeIterator) At() InstantProfileTreeNode
func (*ScaledInstantProfileTreeIterator) HasMore ¶
func (i *ScaledInstantProfileTreeIterator) HasMore() bool
func (*ScaledInstantProfileTreeIterator) NextChild ¶
func (i *ScaledInstantProfileTreeIterator) NextChild() bool
func (*ScaledInstantProfileTreeIterator) StepInto ¶
func (i *ScaledInstantProfileTreeIterator) StepInto() bool
func (*ScaledInstantProfileTreeIterator) StepUp ¶
func (i *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 (i *SliceProfileSeriesIterator) At() InstantProfile
func (*SliceProfileSeriesIterator) Err ¶
func (i *SliceProfileSeriesIterator) Err() error
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) Peek ¶
func (s *TreeStack) Peek() *TreeStackEntry
func (*TreeStack) Pop ¶
func (s *TreeStack) Pop() (*TreeStackEntry, bool)
func (*TreeStack) Push ¶
func (s *TreeStack) Push(e *TreeStackEntry)
type TreeStackEntry ¶
type TreeStackEntry struct {
// contains filtered or unexported fields
}