metrictank: github.com/grafana/metrictank/mdata/chunk/tsz Index | Files

package tsz

import "github.com/grafana/metrictank/mdata/chunk/tsz"

Package tsz implements time-series compression it is a fork of https://github.com/dgryski/go-tsz which implements http://www.vldb.org/pvldb/vol8/p1816-teller.pdf see devdocs/chunk-format.md for more info

Package tsz implements time-series compression it is a fork of https://github.com/dgryski/go-tsz which implements http://www.vldb.org/pvldb/vol8/p1816-teller.pdf see devdocs/chunk-format.md for more info

Index

Package Files

bstream.go finish.go iter.go tsz.go tszlong.go

type Iter Uses

type Iter interface {
    Next() bool
    Values() (uint32, float64)
    Err() error
}

type Iter4h Uses

type Iter4h struct {
    T0 uint32
    // contains filtered or unexported fields
}

Iter4h lets you iterate over a Series4h. It is not concurrency-safe. For more info, see Series4h

func NewIterator4h Uses

func NewIterator4h(b []byte, intervalHint uint32) (*Iter4h, error)

NewIterator4h creates an Iter4h

func (*Iter4h) Err Uses

func (it *Iter4h) Err() error

Err error at the current iterator position

func (*Iter4h) Next Uses

func (it *Iter4h) Next() bool

Next iteration of the series iterator

func (*Iter4h) Values Uses

func (it *Iter4h) Values() (uint32, float64)

Values at the current iterator position

type IterLong Uses

type IterLong struct {
    T0 uint32
    // contains filtered or unexported fields
}

IterLong lets you iterate over a series. It is not concurrency-safe.

func NewIteratorLong Uses

func NewIteratorLong(t0 uint32, b []byte) (*IterLong, error)

NewIteratorLong for the series

func (*IterLong) Err Uses

func (it *IterLong) Err() error

Err error at the current iterator position

func (*IterLong) Next Uses

func (it *IterLong) Next() bool

Next iteration of the series iterator

func (*IterLong) Values Uses

func (it *IterLong) Values() (uint32, float64)

Values at the current iterator position

type Series4h Uses

type Series4h struct {
    sync.Mutex

    // TODO(dgryski): timestamps in the paper are uint64
    T0  uint32
    // contains filtered or unexported fields
}

Series4h is the basic series primitive you can concurrently put values, finish the stream, and create iterators you shouldn't use it for chunks longer than 4.5 hours, due to overflow of the first delta (14 bits), though in some cases, the corresponding iterator can reconstruct the data. Only works for <=9h deltas/chunks though. See https://github.com/grafana/metrictank/pull/1126

func NewSeries4h Uses

func NewSeries4h(t0 uint32) *Series4h

NewSeries4h creates a new Series4h

func (*Series4h) Bytes Uses

func (s *Series4h) Bytes() []byte

Bytes value of the series stream

func (*Series4h) Finish Uses

func (s *Series4h) Finish()

Finish the series by writing an end-of-stream record

func (*Series4h) Iter Uses

func (s *Series4h) Iter(intervalHint uint32) *Iter4h

Iter4h lets you iterate over a series. It is not concurrency-safe.

func (*Series4h) MarshalBinary Uses

func (s *Series4h) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*Series4h) Push Uses

func (s *Series4h) Push(t uint32, v float64)

Push a timestamp and value to the series

func (*Series4h) UnmarshalBinary Uses

func (s *Series4h) UnmarshalBinary(b []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type SeriesLong Uses

type SeriesLong struct {
    sync.Mutex

    // TODO(dgryski): timestamps in the paper are uint64
    T0  uint32 // exposed for caller convenience. do NOT set directly. set via constructor
    T   uint32 // exposed for caller convenience. do NOT set directly. may only be set via Push()

    Finished bool // exposed for caller convenience. do NOT set directly.
    // contains filtered or unexported fields
}

SeriesLong similar to Series4h, except: * it doesn't write t0 to the stream (for callers that track t0 corresponding to a chunk separately) * it doesn't store an initial delta. instead, it assumes a starting delta of 60 and uses delta-of-delta

encoding from the get-go.

* it uses a more compact way to mark end-of-stream

func NewSeriesLong Uses

func NewSeriesLong(t0 uint32) *SeriesLong

New series

func (*SeriesLong) Bytes Uses

func (s *SeriesLong) Bytes() []byte

Bytes value of the series stream

func (*SeriesLong) Finish Uses

func (s *SeriesLong) Finish()

Finish the series by writing an end-of-stream record

func (*SeriesLong) Iter Uses

func (s *SeriesLong) Iter() *IterLong

IterLong lets you iterate over a series. It is not concurrency-safe.

func (*SeriesLong) MarshalBinary Uses

func (s *SeriesLong) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*SeriesLong) Push Uses

func (s *SeriesLong) Push(t uint32, v float64)

Push a timestamp and value to the series

func (*SeriesLong) UnmarshalBinary Uses

func (s *SeriesLong) UnmarshalBinary(b []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

Package tsz imports 6 packages (graph) and is imported by 9 packages. Updated 2019-08-24. Refresh now. Tools for package owners.