timeseries

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type And added in v1.5.1

type And struct {
	Left, Right Filter
}

func (And) Apply added in v1.5.1

func (a And) Apply(cu *cursor.Cursor, re encoding.Resolution, shard, view uint64) *ro2.Bitmap

type Filter

type Filter interface {
	Apply(cu *cursor.Cursor, re encoding.Resolution, shard, view uint64) *ro2.Bitmap
}

type Key

type Key struct {
	View       uint64
	Domain     uint64
	Resolution encoding.Resolution
	Field      models.Field
	Existence  bool
}

func (*Key) Encode added in v1.9.0

func (k *Key) Encode(co uint64, b []byte) []byte

type No added in v1.11.0

type No struct {
	Field  models.Field
	Values []uint64
}

func (*No) Apply added in v1.11.0

func (f *No) Apply(cu *cursor.Cursor, re encoding.Resolution, shard, view uint64) *ro2.Bitmap

type Or added in v1.11.0

type Or struct {
	Left, Right Filter
}

func (Or) Apply added in v1.11.0

func (o Or) Apply(cu *cursor.Cursor, re encoding.Resolution, shard, view uint64) *ro2.Bitmap

type ScanCall added in v1.8.0

type ScanCall func(cu *cursor.Cursor, field models.Field, view, shard uint64, columns *ro2.Bitmap) error

type Timeseries added in v1.5.1

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

func New added in v1.5.1

func New(db *shards.DB, lo *location.Location) *Timeseries

func (*Timeseries) Add added in v1.5.1

func (ts *Timeseries) Add(m *models.Model) error

Add process m and batches it. It must be called in the same goroutine as (*Timeseries)Save

When we reach a shard boundary, existing batch will be saved before adding m. m []byte fields must not be modified because we use reference during translation A safe usage is to release m imediately after calling this method and reset it by calling

*m = models.Model{}

func (*Timeseries) Close added in v1.5.1

func (ts *Timeseries) Close() error

Close releases resources and removes buffers used.

func (*Timeseries) Find added in v1.5.1

func (ts *Timeseries) Find(ctx context.Context, field models.Field, id uint64) (value string)

func (*Timeseries) Get added in v1.5.1

func (ts *Timeseries) Get() *shards.DB

func (*Timeseries) Location added in v1.8.0

func (ts *Timeseries) Location() *location.Location

func (*Timeseries) Save added in v1.5.1

func (ts *Timeseries) Save() error

Save persist all buffered events into pebble key value store. This method is not safe for cocunrrent use. It is intended to be called in the same goroutine that calls (*Timeseries)Add.

The goal is to ensure almost lock free ingestion path ( with exception of translation with uses RWMutex)

func (*Timeseries) Scan added in v1.6.0

func (ts *Timeseries) Scan(
	domainId uint64,
	res encoding.Resolution,
	start, end time.Time,
	filter Filter,
	valueSet models.BitSet,
	cb ScanCall,
) error

func (*Timeseries) Search added in v1.5.1

func (ts *Timeseries) Search(field models.Field, prefix []byte, f func(key []byte, value uint64))

func (*Timeseries) SearchKeys added in v1.10.0

func (ts *Timeseries) SearchKeys(field models.Field, prefix []byte, f func(key []byte) error) error

func (*Timeseries) Select added in v1.5.1

func (ts *Timeseries) Select(
	ctx context.Context,
	values models.BitSet,
	domain string, start,
	end time.Time,
	intrerval query.Interval,
	filters query.Filters,
	cb ScanCall) error

func (*Timeseries) Translate added in v1.5.1

func (ts *Timeseries) Translate(field models.Field, value []byte) uint64

func (*Timeseries) Visitors added in v1.7.0

func (ts *Timeseries) Visitors(start, end time.Time, resolution encoding.Resolution, domain string) (visitors uint64)

Realtime computes total visitors in the last 5 minutes.

type Yes added in v1.11.0

type Yes struct {
	Field  models.Field
	Values []uint64
}

func (*Yes) Apply added in v1.11.0

func (f *Yes) Apply(cu *cursor.Cursor, re encoding.Resolution, shard, view uint64) *ro2.Bitmap

Apply searches for columns matching conditions in f for ra bitmap. ra must be mutex encoded.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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