Documentation ¶
Overview ¶
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 ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iter4h ¶
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 ¶
NewIterator4h creates an Iter4h
type IterLong ¶
type IterLong struct { T0 uint32 // contains filtered or unexported fields }
IterLong lets you iterate over a series. It is not concurrency-safe.
func NewIteratorLong ¶
NewIteratorLong for the series
type Series4h ¶
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 (*Series4h) Finish ¶
func (s *Series4h) Finish()
Finish the series by writing an end-of-stream record
func (*Series4h) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface
func (*Series4h) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface
type SeriesLong ¶
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 (*SeriesLong) Finish ¶
func (s *SeriesLong) Finish()
Finish the series by writing an end-of-stream record
func (*SeriesLong) Iter ¶
func (s *SeriesLong) Iter() *IterLong
IterLong lets you iterate over a series. It is not concurrency-safe.
func (*SeriesLong) MarshalBinary ¶
func (s *SeriesLong) MarshalBinary() ([]byte, error)
MarshalBinary implements the encoding.BinaryMarshaler interface
func (*SeriesLong) Push ¶
func (s *SeriesLong) Push(t uint32, v float64)
Push a timestamp and value to the series
func (*SeriesLong) UnmarshalBinary ¶
func (s *SeriesLong) UnmarshalBinary(b []byte) error
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface