segment

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromTreeToDictKey added in v0.0.37

func FromTreeToDictKey(k string) string

FromTreeToDictKey returns app name from tree key k: given tree key "foo{}:0:-62135596790", the call returns "foo".

Before tags support, segment key form (i.e. app name + tags: foo{key=value}) has been used to reference a dictionary (trie).

func FromTreeToMainKey added in v0.0.37

func FromTreeToMainKey(k string) string

Types

type Addon

type Addon struct {
	Depth int
	T     time.Time
}

type Key added in v0.0.37

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

func NewKey added in v0.0.37

func NewKey(labels map[string]string) *Key

func ParseKey added in v0.0.37

func ParseKey(name string) (*Key, error)

func (*Key) AppName added in v0.0.37

func (k *Key) AppName() string

func (*Key) DictKey added in v0.0.37

func (k *Key) DictKey() string

func (*Key) Labels added in v0.0.37

func (k *Key) Labels() map[string]string

func (*Key) Normalized added in v0.0.37

func (k *Key) Normalized() string

func (*Key) SegmentKey added in v0.0.37

func (k *Key) SegmentKey() string

func (*Key) TreeKey added in v0.0.37

func (k *Key) TreeKey(depth int, t time.Time) string

type ParserState added in v0.0.37

type ParserState int

type Segment

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

func Deserialize

func Deserialize(r io.Reader) (*Segment, error)

func FromBytes

func FromBytes(p []byte) (*Segment, error)

func New

func New() *Segment

func (*Segment) AggregationType added in v0.0.30

func (s *Segment) AggregationType() string

func (*Segment) Bytes

func (s *Segment) Bytes() ([]byte, error)

func (*Segment) DeleteDataBefore added in v0.0.33

func (s *Segment) DeleteDataBefore(retentionThreshold time.Time, cb func(depth int, t time.Time)) bool

func (*Segment) Get

func (s *Segment) Get(st, et time.Time, cb func(depth int, samples, writes uint64, t time.Time, r *big.Rat))

TODO: simplify arguments TODO: validate st < et

func (*Segment) Put

func (s *Segment) Put(st, et time.Time, samples uint64, cb func(depth int, t time.Time, r *big.Rat, addons []Addon))

TODO: simplify arguments TODO: validate st < et

func (*Segment) SampleRate

func (s *Segment) SampleRate() uint32

func (*Segment) Serialize

func (s *Segment) Serialize(w io.Writer) error

func (*Segment) SetMetadata

func (s *Segment) SetMetadata(spyName string, sampleRate uint32, units, aggregationType string)

TODO: this should be refactored

func (*Segment) SpyName

func (s *Segment) SpyName() string

func (*Segment) StartTime added in v0.0.33

func (s *Segment) StartTime() time.Time

func (*Segment) Units added in v0.0.30

func (s *Segment) Units() string

func (*Segment) Visualize

func (s *Segment) Visualize()

This is here for debugging

type Timeline

type Timeline struct {
	StartTime int64    `json:"startTime"`
	Samples   []uint64 `json:"samples"`

	DurationDeltaNormalized int64 `json:"durationDelta"`
	// contains filtered or unexported fields
}

func GenerateTimeline

func GenerateTimeline(st, et time.Time) *Timeline

func (*Timeline) PopulateTimeline

func (tl *Timeline) PopulateTimeline(s *Segment)

type TmpltVars

type TmpltVars struct {
	Data string
}

Jump to

Keyboard shortcuts

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