tree

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombineTree added in v0.0.38

func CombineTree(leftTree, rightTree *Tree) (*Tree, *Tree)

CombineTree aligns 2 trees by making them having the same structure with the same number of nodes TODO: create a new struct?

Types

type Flamebearer

type Flamebearer struct {
	Names    []string `json:"names"`
	Levels   [][]int  `json:"levels"`
	NumTicks int      `json:"numTicks"`
	MaxSelf  int      `json:"maxSelf"`
	// TODO: see note in render.go
	SpyName    string `json:"spyName"`
	SampleRate uint32 `json:"sampleRate"`
	Units      string `json:"units"`
	Format     Format `json:"format"`
}

func CombineToFlamebearerStruct added in v0.0.38

func CombineToFlamebearerStruct(leftTree, rightTree *Tree, maxNodes int) *Flamebearer

CombineToFlamebearerStruct generates the Flamebearer struct from 2 trees. They must be the response trees from CombineTree (i.e. all children nodes must be the same length). The Flamebearer struct returned from this function is different to the one returned from Tree.FlamebearerStruct(). It has the following structure:

i+0 = x offset, left  tree
i+1 = total   , left  tree
i+2 = self    , left  tree
i+3 = x offset, right tree
i+4 = total   , right tree
i+5 = self    , right tree
i+6 = index in the names array

type Format added in v0.0.38

type Format string
const (
	FormatSingle Format = "single"
	FormatDouble Format = "double"
)

type Tree

type Tree struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func Deserialize

func Deserialize(d *dict.Dict, r io.Reader) (*Tree, error)

func DeserializeNoDict

func DeserializeNoDict(r io.Reader) (*Tree, error)

func FromBytes

func FromBytes(d *dict.Dict, p []byte) (*Tree, error)

func New

func New() *Tree

func (*Tree) Bytes

func (t *Tree) Bytes(d *dict.Dict, maxNodes int) ([]byte, error)

func (*Tree) Clone

func (t *Tree) Clone(r *big.Rat) *Tree

func (*Tree) FlamebearerStruct

func (t *Tree) FlamebearerStruct(maxNodes int) *Flamebearer

func (*Tree) Insert

func (t *Tree) Insert(key []byte, value uint64)

func (*Tree) InsertInt added in v0.0.40

func (t *Tree) InsertInt(key []byte, value int)

func (*Tree) Iterate added in v0.0.37

func (t *Tree) Iterate(cb func(key []byte, val uint64))

func (*Tree) MarshalJSON

func (t *Tree) MarshalJSON() ([]byte, error)

func (*Tree) Merge

func (t *Tree) Merge(srcTrieI merge.Merger)

func (*Tree) Samples

func (t *Tree) Samples() uint64

func (*Tree) Serialize

func (t *Tree) Serialize(d *dict.Dict, maxNodes int, w io.Writer) error

func (*Tree) SerializeNoDict

func (t *Tree) SerializeNoDict(maxNodes int, w io.Writer) error

func (*Tree) SerializeTruncate added in v0.0.40

func (t *Tree) SerializeTruncate(d *dict.Dict, maxNodes int, w io.Writer) error

func (*Tree) String

func (t *Tree) String() string

Jump to

Keyboard shortcuts

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