segment

package
v0.0.0-...-e488709 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeGlobalState

func InitializeGlobalState(resolution time.Duration, multiplier int)

TODO: global state is not good

Types

type Addon

type Addon struct {
	Depth int
	T     time.Time
}

type Segment

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

func Deserialize

func Deserialize(resolution time.Duration, multiplier int, r io.Reader) (*Segment, error)

func FromBytes

func FromBytes(resolution time.Duration, multiplier int, p []byte) *Segment

func New

func New(resolution time.Duration, multiplier int) *Segment

func (*Segment) Bytes

func (t *Segment) Bytes() []byte

func (*Segment) Get

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

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: just give d+t info here

func (*Segment) SampleRate

func (s *Segment) SampleRate() int

func (*Segment) Serialize

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

func (*Segment) SetMetadata

func (s *Segment) SetMetadata(spyName string, sampleRate int)

func (*Segment) SpyName

func (s *Segment) SpyName() 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"`

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

func GenerateTimeline

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

func (*Timeline) PopulateTimeline

func (tl *Timeline) PopulateTimeline(st, et time.Time, 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